Changeset 1328


Ignore:
Timestamp:
Nov 10, 2006, 4:38:09 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • Wrote manual pages for img2irc, cacaplay and cacaserver.
Location:
libcaca/trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/doc/Makefile.am

    r1103 r1328  
    44
    55doxygen_DOX = libcaca.dox user.dox migrating.dox tutorial.dox style.dox
    6 man_MANS = caca-config.1 cacafire.1 cacaview.1
     6man_MANS = caca-config.1 cacafire.1 cacaview.1 cacaserver.1 img2irc.1 cacaplay.1
    77
    88if BUILD_DOCUMENTATION
  • libcaca/trunk/doc/cacaview.1

    r248 r1328  
    5151.B cacaview
    5252it is completely useless when run without an argument.
     53.SH SEE ALSO
     54img2irc(1)
    5355.SH AUTHOR
    5456This manual page was written by Sam Hocevar <sam@zoy.org>.
  • libcaca/trunk/src/img2irc.c

    r1308 r1328  
    2424#include "common-image.h"
    2525
     26static void usage(int argc, char **argv)
     27{
     28    fprintf(stderr, "Usage: %s <image>\n", argv[0]);
     29    fprintf(stderr, "       %s <image> <columns>\n", argv[0]);
     30    fprintf(stderr, "       %s [-h|--help]\n", argv[0]);
     31}
     32
    2633int main(int argc, char **argv)
    2734{
     
    3138    unsigned long int len;
    3239    struct image *i;
    33     int cols = 56, lines;
     40    int cols, lines;
    3441
    35     if(argc != 2)
     42    if(argc < 2 || argc > 3)
    3643    {
    3744        fprintf(stderr, "%s: wrong argument count\n", argv[0]);
     45        usage(argc, argv);
    3846        return 1;
     47    }
     48
     49    if(!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help"))
     50    {
     51        fprintf(stderr, "%s: convert images to IRC file data\n", argv[0]);
     52        usage(argc, argv);
     53        return 0;
    3954    }
    4055
     
    5570
    5671    /* Assume a 6×10 font */
     72    cols = argc == 3 ? atoi(argv[2]) : 0;
     73    cols = cols ? cols : 60;
    5774    lines = cols * i->h * 6 / i->w / 10;
    5875
Note: See TracChangeset for help on using the changeset viewer.