Changeset 1328
- Timestamp:
- Nov 10, 2006, 4:38:09 PM (17 years ago)
- Location:
- libcaca/trunk
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/doc/Makefile.am
r1103 r1328 4 4 5 5 doxygen_DOX = libcaca.dox user.dox migrating.dox tutorial.dox style.dox 6 man_MANS = caca-config.1 cacafire.1 cacaview.1 6 man_MANS = caca-config.1 cacafire.1 cacaview.1 cacaserver.1 img2irc.1 cacaplay.1 7 7 8 8 if BUILD_DOCUMENTATION -
libcaca/trunk/doc/cacaview.1
r248 r1328 51 51 .B cacaview 52 52 it is completely useless when run without an argument. 53 .SH SEE ALSO 54 img2irc(1) 53 55 .SH AUTHOR 54 56 This manual page was written by Sam Hocevar <sam@zoy.org>. -
libcaca/trunk/src/img2irc.c
r1308 r1328 24 24 #include "common-image.h" 25 25 26 static 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 26 33 int main(int argc, char **argv) 27 34 { … … 31 38 unsigned long int len; 32 39 struct image *i; 33 int cols = 56, lines;40 int cols, lines; 34 41 35 if(argc != 2)42 if(argc < 2 || argc > 3) 36 43 { 37 44 fprintf(stderr, "%s: wrong argument count\n", argv[0]); 45 usage(argc, argv); 38 46 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; 39 54 } 40 55 … … 55 70 56 71 /* Assume a 6×10 font */ 72 cols = argc == 3 ? atoi(argv[2]) : 0; 73 cols = cols ? cols : 60; 57 74 lines = cols * i->h * 6 / i->w / 10; 58 75
Note: See TracChangeset
for help on using the changeset viewer.