Changeset 1115 for toilet/trunk/src
- Timestamp:
- Sep 27, 2006, 1:13:01 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
toilet/trunk/src/main.c
r1114 r1115 50 50 char const *export = "utf8"; 51 51 char const *font = "mono9"; 52 char const *dir = "/usr/share/figlet/"; 52 53 unsigned int flag_gay = 0; 53 54 unsigned int flag_metal = 0; … … 65 66 /* Long option, needs arg, flag, short option */ 66 67 { "font", 1, NULL, 'f' }, 68 { "directory", 1, NULL, 'd' }, 67 69 { "width", 1, NULL, 'w' }, 68 70 { "gay", 0, NULL, 'g' }, … … 75 77 }; 76 78 77 int c = getopt_long(argc, argv, " f:w:gmihI:v",79 int c = getopt_long(argc, argv, "d:f:I:w:ghimv", 78 80 long_options, &option_index); 79 81 # else 80 82 # define MOREINFO "Try `%s -h' for more information.\n" 81 int c = getopt(argc, argv, " f:w:gmihI:v");83 int c = getopt(argc, argv, "d:f:I:w:ghimv"); 82 84 # endif 83 85 if(c == -1) … … 97 99 case 'f': /* --font */ 98 100 font = optarg; 101 break; 102 case 'd': /* --directory */ 103 dir = optarg; 99 104 break; 100 105 case 'g': /* --gay */ … … 135 140 return 0; 136 141 case 2: 137 printf(" /usr/share/figlet\n");142 printf("%s\n", dir); 138 143 return 0; 139 144 case 3: 140 printf(" mono9\n");145 printf("%s\n", font); 141 146 return 0; 142 147 case 4: … … 217 222 static void usage(void) 218 223 { 219 printf("Usage: toilet [ -g mihv ] [ message]\n");224 printf("Usage: toilet [ -ghimv ] [ -d fontdirectory ]\n"); 220 225 printf(" [ -f fontfile ] [ -w outputwidth ]\n"); 221 printf(" [ -I infocode ] \n");226 printf(" [ -I infocode ] [ message ]\n"); 222 227 # ifdef HAVE_GETOPT_LONG 223 228 printf(" -f, --font <fontfile> select the font\n"); 229 printf(" -d, --directory <dir> specify font directory\n"); 224 230 printf(" -w, --width <width> set output width\n"); 225 231 printf(" -g, --gay add a rainbow effect to the text\n"); … … 231 237 # else 232 238 printf(" -f <fontfile> select the font\n"); 239 printf(" -d <dir> specify font directory\n"); 233 240 printf(" -w <width> set output width\n"); 234 241 printf(" -g add a rainbow effect to the text\n");
Note: See TracChangeset
for help on using the changeset viewer.