- Timestamp:
- Nov 30, 2006, 5:51:38 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
toilet/trunk/src/main.c
r1404 r1441 18 18 #include "config.h" 19 19 20 #if defined (HAVE_INTTYPES_H)20 #if defined HAVE_INTTYPES_H 21 21 # include <inttypes.h> 22 22 #endif 23 #if defined (HAVE_GETOPT_H)23 #if defined HAVE_GETOPT_H 24 24 # include <getopt.h> 25 25 #endif 26 #if defined (HAVE_SYS_IOCTL_H) && defined(HAVE_TIOCGWINSZ)26 #if defined HAVE_SYS_IOCTL_H && defined HAVE_TIOCGWINSZ 27 27 # include <sys/ioctl.h> 28 28 #endif … … 38 38 39 39 static void version(void); 40 #if defined (HAVE_GETOPT_H)40 #if defined HAVE_GETOPT_H 41 41 static void usage(void); 42 42 #endif … … 60 60 cx->nfilters = 0; 61 61 62 #if defined (HAVE_GETOPT_H)62 #if defined HAVE_GETOPT_H 63 63 for(;;) 64 64 { … … 128 128 case 't': /* --termwidth */ 129 129 { 130 #if defined (HAVE_SYS_IOCTL_H) && defined(HAVE_TIOCGWINSZ)130 #if defined HAVE_SYS_IOCTL_H && defined HAVE_TIOCGWINSZ 131 131 struct winsize ws; 132 132 … … 216 216 } 217 217 218 #if defined (HAVE_GETOPT_H)218 #if defined HAVE_GETOPT_H 219 219 # define USAGE \ 220 220 "Usage: toilet [ -hkostvSW ] [ -d fontdirectory ]\n" \ … … 225 225 #endif 226 226 227 #if defined HAVE_GETOPT_LONG 228 # define HELP \ 229 " -f, --font <name> select the font\n" \ 230 " -d, --directory <dir> specify font directory\n" \ 231 " -s, -S, -k, -W, -o render mode (default, force smushing,\n" \ 232 " kerning, full width, overlap)\n" \ 233 " -w, --width <width> set output width\n" \ 234 " -t, --termwidth adapt to terminal's width\n" \ 235 " -F, --filter <filters> apply one or several filters to the text\n" \ 236 " -F, --filter list list available filters\n" \ 237 " --gay rainbow filter (same as -F gay)\n" \ 238 " --metal metal filter (same as -F metal)\n" \ 239 " -E, --export <format> select export format\n" \ 240 " -E, --export list list available export formats\n" \ 241 " --irc output IRC colour codes (same as -E irc)\n" \ 242 " --html output an HTML document (same as -E html)\n" \ 243 " -h, --help display this help and exit\n" \ 244 " -I, --infocode <code> print FIGlet-compatible infocode\n" \ 245 " -v, --version output version information and exit\n" 246 #else 247 # define HELP \ 248 " -f <name> select the font\n" \ 249 " -d <dir> specify font directory\n" \ 250 " -s, -S, -k, -W, -o render mode (default, force smushing,\n" \ 251 " kerning, full width, overlap)\n" \ 252 " -w <width> set output width\n" \ 253 " -t adapt to terminal's width\n" \ 254 " -F <filters> apply one or several filters to the text\n" \ 255 " -F list list available filters\n" \ 256 " -E <format> select export format\n" \ 257 " -E list list available export formats\n" \ 258 " -h display this help and exit\n" \ 259 " -I <code> print FIGlet-compatible infocode\n" \ 260 " -v output version information and exit\n" 261 #endif 262 227 263 static void version(void) 228 264 { … … 239 275 " http://libcaca.zoy.org/toilet.html\n" 240 276 "\n" 241 USAGE, 242 VERSION, DATE); 277 "%s", VERSION, DATE, USAGE); 243 278 } 244 279 245 #if defined (HAVE_GETOPT_H)280 #if defined HAVE_GETOPT_H 246 281 static void usage(void) 247 282 { 248 printf(USAGE); 249 # ifdef HAVE_GETOPT_LONG 250 printf(" -f, --font <name> select the font\n"); 251 printf(" -d, --directory <dir> specify font directory\n"); 252 printf(" -s, -S, -k, -W, -o render mode (default, force smushing,\n"); 253 printf(" kerning, full width, overlap)\n"); 254 printf(" -w, --width <width> set output width\n"); 255 printf(" -t, --termwidth adapt to terminal's width\n"); 256 printf(" -F, --filter <filters> apply one or several filters to the text\n"); 257 printf(" -F, --filter list list available filters\n"); 258 printf(" --gay rainbow filter (same as -F gay)\n"); 259 printf(" --metal metal filter (same as -F metal)\n"); 260 printf(" -E, --export <format> select export format\n"); 261 printf(" -E, --export list list available export formats\n"); 262 printf(" --irc output IRC colour codes (same as -E irc)\n"); 263 printf(" --html output an HTML document (same as -E html)\n"); 264 printf(" -h, --help display this help and exit\n"); 265 printf(" -I, --infocode <code> print FIGlet-compatible infocode\n"); 266 printf(" -v, --version output version information and exit\n"); 267 # else 268 printf(" -f <name> select the font\n"); 269 printf(" -d <dir> specify font directory\n"); 270 printf(" -s, -S, -k, -W, -o render mode (default, force smushing,\n"); 271 printf(" kerning, full width, overlap)\n"); 272 printf(" -w <width> set output width\n"); 273 printf(" -t adapt to terminal's width\n"); 274 printf(" -F <filters> apply one or several filters to the text\n"); 275 printf(" -F list list available filters\n"); 276 printf(" -E <format> select export format\n"); 277 printf(" -E list list available export formats\n"); 278 printf(" -h display this help and exit\n"); 279 printf(" -I <code> print FIGlet-compatible infocode\n"); 280 printf(" -v output version information and exit\n"); 281 # endif 283 printf("%s%s", HELP, USAGE); 282 284 } 283 285 #endif
Note: See TracChangeset
for help on using the changeset viewer.