Changeset 1441 for toilet


Ignore:
Timestamp:
Nov 30, 2006, 5:51:38 PM (13 years ago)
Author:
Sam Hocevar
Message:
  • Cosmetic.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • toilet/trunk/src/main.c

    r1404 r1441  
    1818#include "config.h"
    1919
    20 #if defined(HAVE_INTTYPES_H)
     20#if defined HAVE_INTTYPES_H
    2121#   include <inttypes.h>
    2222#endif
    23 #if defined(HAVE_GETOPT_H)
     23#if defined HAVE_GETOPT_H
    2424#   include <getopt.h>
    2525#endif
    26 #if defined(HAVE_SYS_IOCTL_H) && defined(HAVE_TIOCGWINSZ)
     26#if defined HAVE_SYS_IOCTL_H && defined HAVE_TIOCGWINSZ
    2727#   include <sys/ioctl.h>
    2828#endif
     
    3838
    3939static void version(void);
    40 #if defined(HAVE_GETOPT_H)
     40#if defined HAVE_GETOPT_H
    4141static void usage(void);
    4242#endif
     
    6060    cx->nfilters = 0;
    6161
    62 #if defined(HAVE_GETOPT_H)
     62#if defined HAVE_GETOPT_H
    6363    for(;;)
    6464    {
     
    128128        case 't': /* --termwidth */
    129129        {
    130 #if defined(HAVE_SYS_IOCTL_H) && defined(HAVE_TIOCGWINSZ)
     130#if defined HAVE_SYS_IOCTL_H && defined HAVE_TIOCGWINSZ
    131131            struct winsize ws;
    132132
     
    216216}
    217217
    218 #if defined(HAVE_GETOPT_H)
     218#if defined HAVE_GETOPT_H
    219219#   define USAGE \
    220220    "Usage: toilet [ -hkostvSW ] [ -d fontdirectory ]\n" \
     
    225225#endif
    226226
     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
    227263static void version(void)
    228264{
     
    239275    "        http://libcaca.zoy.org/toilet.html\n"
    240276    "\n"
    241     USAGE,
    242     VERSION, DATE);
     277    "%s", VERSION, DATE, USAGE);
    243278}
    244279
    245 #if defined(HAVE_GETOPT_H)
     280#if defined HAVE_GETOPT_H
    246281static void usage(void)
    247282{
    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);
    282284}
    283285#endif
Note: See TracChangeset for help on using the changeset viewer.