Changeset 1917 for libcaca/trunk
- Timestamp:
- Nov 7, 2007, 11:03:50 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/src/img2txt.c
r1916 r1917 38 38 #include "common-image.h" 39 39 40 #define IMG2TXTVERSION "0.1" 41 40 42 static void usage(int argc, char **argv) 41 43 { … … 45 47 fprintf(stderr, "Options:\n"); 46 48 fprintf(stderr, " -h, --help\t\t\tThis help\n"); 49 fprintf(stderr, " -v, --version\t\t\tVersion of the program\n"); 47 50 fprintf(stderr, " -W, --width=WIDTH\t\tWidth of resulting image\n"); 48 51 fprintf(stderr, " -H, --height=HEIGHT\t\tHeight of resulting image\n"); … … 74 77 } 75 78 79 static void version(void) 80 { 81 printf( 82 "img2txt Copyright 2006-2007 Sam Hocevar and Jean-Yves Lamoureux\n" 83 "Internet: <sam@zoy.org> <jylam@lnxscene.org> Version: %s, date: %s\n" 84 "\n" 85 "img2txt, along with its documentation, may be freely copied and distributed.\n" 86 "\n" 87 "The latest version of img2txt is available from the web site,\n" 88 " http://libcaca.zoy.org/ in the libcaca package.\n" 89 "\n" 90 , VERSION, __DATE__); 91 } 76 92 int main(int argc, char **argv) 77 93 { … … 106 122 { "contrast", 1, NULL, 'c' }, 107 123 { "help", 0, NULL, 'h' }, 124 { "version", 0, NULL, 'v' }, 108 125 }; 109 int c = mygetopt(argc, argv, "W:H:f:d:g:b:c:h ", long_options, &option_index);126 int c = mygetopt(argc, argv, "W:H:f:d:g:b:c:h:v", long_options, &option_index); 110 127 if(c == -1) 111 128 break; … … 125 142 dither = myoptarg; 126 143 break; 144 case 'g': /* --gamma */ 145 gamma = atof(myoptarg); 146 break; 147 case 'b': /* --brightness */ 148 brightness = atof(myoptarg); 149 break; 150 case 'c': /* --contrast */ 151 contrast = atof(myoptarg); 152 break; 127 153 case 'h': /* --help */ 128 154 usage(argc, argv); 129 155 return 0; 130 156 break; 131 case 'g': /* --gamma */ 132 gamma = atof(myoptarg); 133 break; 134 case 'b': /* --brightness */ 135 brightness = atof(myoptarg); 136 break; 137 case 'c': /* --contrast */ 138 contrast = atof(myoptarg); 157 case 'v': /* --version */ 158 version(); 159 return 0; 139 160 break; 140 161 default:
Note: See TracChangeset
for help on using the changeset viewer.