diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-02-21 13:30:51 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-02-21 13:31:26 +0200 |
commit | 1213cf065e9b3a5fb45d00276b3d168462838c17 (patch) | |
tree | 8d8f3cb7617465139f0051c10ef80fa9c2c91369 /src/getopt.m4 | |
parent | 5bfe69d55cff8940fd3a84ff479e6e8308b164f4 (diff) | |
download | wydawca-1213cf065e9b3a5fb45d00276b3d168462838c17.tar.gz wydawca-1213cf065e9b3a5fb45d00276b3d168462838c17.tar.bz2 |
Remove trailing whitespace
Diffstat (limited to 'src/getopt.m4')
-rw-r--r-- | src/getopt.m4 | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/src/getopt.m4 b/src/getopt.m4 index d6f5580..83cc45f 100644 --- a/src/getopt.m4 +++ b/src/getopt.m4 @@ -1,6 +1,6 @@ dnl This file is part of GNU Rush. dnl Copyright (C) 2007, 2008, 2009 Sergey Poznyakoff. -dnl +dnl dnl GNU Rush is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 3, or (at your option) @@ -66,7 +66,7 @@ dnl define([<GROUP>],[<dnl divert(3) { NULL, NULL, 0, N_("prep([<$1>])") }, -divert(-1)>]) +divert(-1)>]) define([<__GATHER_OPTIONS>],[< define([<KEY>],ifelse([<$2>],,[<OPTION_>]upcase(patsubst($1,-,_)),'$2')) @@ -92,12 +92,12 @@ ifelse([<$2>],,,dnl dnl OPTION(long-opt, short-opt, [arg], [descr]) dnl Introduce a command line option. Arguments: -dnl long-opt Long option. +dnl long-opt Long option. dnl short-opt Short option (a single char) dnl (At least one of long-opt or short-opt must be present) dnl dnl Optional arguments: -dnl arg Option argument. +dnl arg Option argument. dnl descr Option description dnl dnl If arg is absent, the option does not take any arguments. If arg is @@ -124,7 +124,7 @@ dnl long-opt Long option. dnl short-opt Short option (a single char) dnl (At least one of long-opt or short-opt must be present) dnl An OPTION statement may be followed by any number of ALIAS statements. -dnl +dnl define([<ALIAS>],[< __GATHER_OPTIONS($1,$2) >]) @@ -180,11 +180,11 @@ ifelse([<$#>],3,opterr = 0;) { default: ifelse([<$#>],3,$3,[<exit(1)>]); - + undivert(4) } } - } + } >]) define([<STDFUNC>],[< @@ -196,19 +196,19 @@ const char *program_version = [<$1>]; static char doc[] = N_("[<$3>]"); static char args_doc[] = N_("[<$4>]"); const char *program_bug_address = "<" PACKAGE_BUGREPORT ">"; - + #define DESCRCOLUMN 30 #define RMARGIN 79 #define GROUPCOLUMN 2 #define USAGECOLUMN 13 - + static void indent (size_t start, size_t col) { for (; start < col; start++) putchar (' '); } - + static void print_option_descr (const char *descr, size_t lmargin, size_t rmargin) { @@ -243,9 +243,9 @@ void print_help(void) { unsigned i; - + printf ("%s %s [%s]... %s\n", _("Usage:"), [<$2>], _("[<OPTION>]"), - gettext (args_doc)); + gettext (args_doc)); if (doc && doc[0]) print_option_descr(gettext (doc), 0, RMARGIN); putchar ('\n'); @@ -294,7 +294,7 @@ print_help(void) putchar ('\n'); } } - + putchar ('\n'); dnl ************************************************************************** dnl This string cannot be split over several lines, because this would trigger @@ -315,13 +315,13 @@ print_usage(void) char buf[RMARGIN+1]; #define FLUSH dnl - do dnl - { dnl - buf[n] = 0; dnl - printf ("%s\n", buf); dnl - n = USAGECOLUMN; dnl - memset (buf, ' ', n); dnl - } dnl + do dnl + { dnl + buf[n] = 0; dnl + printf ("%s\n", buf); dnl + n = USAGECOLUMN; dnl + memset (buf, ' ', n); dnl + } dnl while (0) #define ADDC(c) dnl do { if (n == RMARGIN) FLUSH; buf[n++] = c; } while (0) @@ -352,12 +352,12 @@ print_usage(void) if (opthelp[i].opt && opthelp[i].descr && opthelp[i].opt[1] != '-' && opthelp[i].arg) { - size_t len = 5 + size_t len = 5 + strlen (opthelp[i].arg) + (opthelp[i].is_optional ? 2 : 1); if (n + len > RMARGIN) FLUSH; - buf[n++] = ' '; - buf[n++] = '['; + buf[n++] = ' '; + buf[n++] = '['; buf[n++] = '-'; buf[n++] = opthelp[i].opt[1]; if (opthelp[i].is_optional) @@ -396,8 +396,8 @@ print_usage(void) + (opthelp[i].arg ? 1 + strlen (opthelp[i].arg) + (opthelp[i].is_optional ? 2 : 0) : 0); if (n + len > RMARGIN) FLUSH; - buf[n++] = ' '; - buf[n++] = '['; + buf[n++] = ' '; + buf[n++] = '['; strcpy (&buf[n], longopt); n += strlen (longopt); if (opthelp[i].arg) @@ -420,7 +420,7 @@ print_usage(void) } } FLUSH; - + } const char version_etc_copyright[] = @@ -444,7 +444,7 @@ void print_version(const char *program_version, FILE *stream) { print_version_only(program_version, stream); - + dnl ************************************************************************** dnl This string cannot be split over serveal lines, because this would trigger dnl a bug in GNU M4 (version 1.4.9 and 1.4.10), which would insert #line @@ -452,7 +452,7 @@ dnl directives between the lines. dnl ************************************************************************** fputs (_("License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\n\n"), stream); - + dnl /* TRANSLATORS: %s denotes an author name. */ dnl fprintf (stream, _("Written by %s.\n"), "Sergey Poznyakoff"); } @@ -464,11 +464,11 @@ popdef([<FLUSH>]) define([<OPTIONS_BEGIN>], [<divert(-1) - define([<GETOPT_STYLE>],[<$1>]) + define([<GETOPT_STYLE>],[<$1>]) ifelse([<$1>],[<gnu>], [<STDFUNC([<$2 " (" PACKAGE_NAME ") " PACKAGE_VERSION>], [<$2>], [<$3>], [<$4>])>]) >]) - + define([<OPTIONS_END>],[< ifelse(GETOPT_STYLE,[<gnu>],[< GROUP([<Other options>]) |