Changeset 391
- Timestamp:
- Jan 4, 2005, 12:13:01 AM (18 years ago)
- Location:
- pwntcha/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pwntcha/trunk/configure.ac
r389 r391 18 18 AC_C_INLINE 19 19 AC_TYPE_SIZE_T 20 21 AC_CHECK_FUNCS(getopt_long) 20 22 21 23 # Use OpenCV? -
pwntcha/trunk/src/main.c
r389 r391 18 18 #include "common.h" 19 19 20 #ifdef HAVE_GETOPT_LONG 21 # define MOREINFO "Try `%s --help' for more information.\n" 22 #else 23 # define MOREINFO "Try `%s -h' for more information.\n" 24 #endif 25 20 26 int main(int argc, char *argv[]) 21 27 { … … 28 34 { 29 35 int this_option_optind = optind ? optind : 1; 36 #ifdef HAVE_GETOPT_LONG 30 37 int option_index = 0; 31 38 static struct option long_options[] = … … 38 45 39 46 c = getopt_long(argc, argv, "hm:v", long_options, &option_index); 47 #else 48 c = getopt(argc, argv, "hm:v"); 49 #endif 40 50 if(c == -1) 41 51 break; … … 45 55 case 'h': /* --help */ 46 56 printf("Usage: %s [OPTION]... FILE...\n", argv[0]); 57 #ifdef HAVE_GETOPT_LONG 47 58 printf(" -m, --mode force operating mode\n"); 48 59 printf(" -h, --help display this help and exit\n"); 49 60 printf(" -v, --version output version information and exit\n"); 61 #else 62 printf(" -m force operating mode\n"); 63 printf(" -h display this help and exit\n"); 64 printf(" -v output version information and exit\n"); 65 #endif 50 66 return 0; 51 67 case 'm': /* --mode */ … … 53 69 break; 54 70 case 'v': /* --version */ 55 printf("pwntcha ( CAPTCHAdecoder) %s\n", VERSION);71 printf("pwntcha (captcha decoder) %s\n", VERSION); 56 72 printf("Written by Sam Hocevar.\n"); 57 73 printf("\n"); … … 61 77 return 0; 62 78 case '?': 63 break; 79 printf(MOREINFO, argv[0]); 80 return 1; 64 81 default: 65 82 printf("%s: invalid option -- %i\n", argv[0], c); 66 printf( "Try `%s --help' for more information.\n", argv[0]);83 printf(MOREINFO, argv[0]); 67 84 return 1; 68 85 } … … 72 89 { 73 90 printf("%s: too few arguments\n", argv[0]); 74 printf( "Try `%s --help' for more information.\n", argv[0]);91 printf(MOREINFO, argv[0]); 75 92 return 1; 76 93 } … … 103 120 else 104 121 { 105 fprintf(stderr, "%s: could not guess CAPTCHAtype\n", argv[0]);122 fprintf(stderr, "%s: could not guess captcha type\n", argv[0]); 106 123 printf("\n"); 107 124 image_free(img);
Note: See TracChangeset
for help on using the changeset viewer.