maint: define usage note about mandatory args centrally
authorBernhard Voelker <mail@bernhard-voelker.de>
Wed, 23 Jan 2013 00:03:38 +0000 (01:03 +0100)
committerBernhard Voelker <mail@bernhard-voelker.de>
Wed, 23 Jan 2013 00:03:38 +0000 (01:03 +0100)
Each program with at least one long option which is marked as
'required_argument' and which has also a short option for that
option, should print a note about mandatory arguments.
Define that well-known note centrally and use it rather than
literal printf/fputs, and add it where it was missing.

* src/system.h (emit_mandatory_arg_note): Add new function.

* src/cp.c (usage): Use it rather than literal printf/fputs.
* src/csplit.c, src/cut.c, src/date.c, src/df.c, src/du.c:
* src/expand.c, src/fmt.c, src/fold.c, src/head.c, src/install.c:
* src/kill.c, src/ln.c, src/ls.c, src/mkdir.c, src/mkfifo.c:
* src/mknod.c, src/mv.c, src/nl.c, src/od.c, src/paste.c:
* src/pr.c, src/ptx.c, src/shred.c, src/shuf.c, src/sort.c:
* src/split.c, src/stdbuf.c, src/tac.c, src/tail.c, src/timeout.c:
* src/touch.c, src/truncate.c, src/unexpand.c, src/uniq.c:
Likewise.

* src/base64.c (usage): Add call of the above new function
because at least one long option has a required argument.
* src/basename.c, src/chcon.c, src/date.c, src/env.c:
* src/nice.c, src/runcon.c, src/seq.c, src/stat.c, src/stty.c:
Likewise.

45 files changed:
src/base64.c
src/basename.c
src/chcon.c
src/cp.c
src/csplit.c
src/cut.c
src/date.c
src/df.c
src/du.c
src/env.c
src/expand.c
src/fmt.c
src/fold.c
src/head.c
src/install.c
src/kill.c
src/ln.c
src/ls.c
src/mkdir.c
src/mkfifo.c
src/mknod.c
src/mv.c
src/nice.c
src/nl.c
src/od.c
src/paste.c
src/pr.c
src/ptx.c
src/runcon.c
src/seq.c
src/shred.c
src/shuf.c
src/sort.c
src/split.c
src/stat.c
src/stdbuf.c
src/stty.c
src/system.h
src/tac.c
src/tail.c
src/timeout.c
src/touch.c
src/truncate.c
src/unexpand.c
src/uniq.c

index 675519f..0a40068 100644 (file)
@@ -60,7 +60,10 @@ usage (int status)
       printf (_("\
 Usage: %s [OPTION]... [FILE]\n\
 Base64 encode or decode FILE, or standard input, to standard output.\n\
-\n"), program_name);
+"), program_name);
+
+      emit_mandatory_arg_note ();
+
       fputs (_("\
   -d, --decode          decode data\n\
   -i, --ignore-garbage  when decoding, ignore non-alphabet characters\n\
index 79ce1df..074d284 100644 (file)
@@ -53,9 +53,10 @@ Usage: %s NAME [SUFFIX]\n\
       fputs (_("\
 Print NAME with any leading directory components removed.\n\
 If specified, also remove a trailing SUFFIX.\n\
-\n\
 "), stdout);
 
+      emit_mandatory_arg_note ();
+
       fputs (_("\
   -a, --multiple       support multiple arguments and treat each as a NAME\n\
   -s, --suffix=SUFFIX  remove a trailing SUFFIX\n\
index 9051ec6..56f2caa 100644 (file)
@@ -357,8 +357,10 @@ Usage: %s [OPTION]... CONTEXT FILE...\n\
       fputs (_("\
 Change the security context of each FILE to CONTEXT.\n\
 With --reference, change the security context of each FILE to that of RFILE.\n\
-\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       fputs (_("\
       --dereference      affect the referent of each symbolic link (this is\n\
                          the default), rather than the symbolic link itself\n\
index 625ea0b..0d64f9f 100644 (file)
--- a/src/cp.c
+++ b/src/cp.c
@@ -161,11 +161,10 @@ Usage: %s [OPTION]... [-T] SOURCE DEST\n\
               program_name, program_name, program_name);
       fputs (_("\
 Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n\
-\n\
-"), stdout);
-      fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       fputs (_("\
   -a, --archive                same as -dR --preserve=all\n\
       --attributes-only        don't copy the file data, just the attributes\n\
index a8b5694..22f3ad4 100644 (file)
@@ -1455,11 +1455,10 @@ Usage: %s [OPTION]... FILE PATTERN...\n\
       fputs (_("\
 Output pieces of FILE separated by PATTERN(s) to files 'xx00', 'xx01', ...,\n\
 and output byte counts of each piece to standard output.\n\
-\n\
-"), stdout);
-      fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       fputs (_("\
   -b, --suffix-format=FORMAT  use sprintf FORMAT instead of %02d\n\
   -f, --prefix=PREFIX        use PREFIX instead of 'xx'\n\
index 7e877cb..4059ecc 100644 (file)
--- a/src/cut.c
+++ b/src/cut.c
@@ -192,11 +192,10 @@ Usage: %s OPTION... [FILE]...\n\
               program_name);
       fputs (_("\
 Print selected parts of lines from each FILE to standard output.\n\
-\n\
-"), stdout);
-      fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       fputs (_("\
   -b, --bytes=LIST        select only these bytes\n\
   -c, --characters=LIST   select only these characters\n\
index 0a434a6..ec66f76 100644 (file)
@@ -127,7 +127,11 @@ Usage: %s [OPTION]... [+FORMAT]\n\
               program_name, program_name);
       fputs (_("\
 Display the current time in the given FORMAT, or set the system date.\n\
-\n\
+"), stdout);
+
+      emit_mandatory_arg_note ();
+
+      fputs (_("\
   -d, --date=STRING         display time described by STRING, not 'now'\n\
   -f, --file=DATEFILE       like --date once for each line of DATEFILE\n\
   -I[TIMESPEC], --iso-8601[=TIMESPEC]  output date/time in ISO 8601 format.\n\
index 6c4d653..9523cc1 100644 (file)
--- a/src/df.c
+++ b/src/df.c
@@ -1175,11 +1175,10 @@ usage (int status)
       fputs (_("\
 Show information about the file system on which each FILE resides,\n\
 or all file systems by default.\n\
-\n\
-"), stdout);
-      fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       fputs (_("\
   -a, --all             include dummy file systems\n\
   -B, --block-size=SIZE  scale sizes by SIZE before printing them.  E.g.,\n\
index 9b7f8de..5388466 100644 (file)
--- a/src/du.c
+++ b/src/du.c
@@ -273,11 +273,10 @@ Usage: %s [OPTION]... [FILE]...\n\
 "), program_name, program_name);
       fputs (_("\
 Summarize disk usage of each FILE, recursively for directories.\n\
-\n\
-"), stdout);
-      fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       fputs (_("\
   -a, --all             write counts for all files, not just directories\n\
       --apparent-size   print apparent sizes, rather than disk usage; although\
index 4a3f924..c31d165 100644 (file)
--- a/src/env.c
+++ b/src/env.c
@@ -54,7 +54,11 @@ Usage: %s [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...]\n"),
               program_name);
       fputs (_("\
 Set each NAME to VALUE in the environment and run COMMAND.\n\
-\n\
+"), stdout);
+
+      emit_mandatory_arg_note ();
+
+      fputs (_("\
   -i, --ignore-environment  start with an empty environment\n\
   -0, --null           end each output line with 0 byte rather than newline\n\
   -u, --unset=NAME     remove variable from the environment\n\
index 11cbacf..0b12b02 100644 (file)
@@ -107,11 +107,10 @@ Usage: %s [OPTION]... [FILE]...\n\
       fputs (_("\
 Convert tabs in each FILE to spaces, writing to standard output.\n\
 With no FILE, or when FILE is -, read standard input.\n\
-\n\
-"), stdout);
-      fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       fputs (_("\
   -i, --initial       do not convert tabs after non blanks\n\
   -t, --tabs=NUMBER   have tabs NUMBER characters apart, not 8\n\
index 750401d..d3f5369 100644 (file)
--- a/src/fmt.c
+++ b/src/fmt.c
@@ -271,11 +271,10 @@ usage (int status)
       fputs (_("\
 Reformat each paragraph in the FILE(s), writing to standard output.\n\
 The option -WIDTH is an abbreviated form of --width=DIGITS.\n\
-\n\
-"), stdout);
-      fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       fputs (_("\
   -c, --crown-margin        preserve indentation of first two lines\n\
   -p, --prefix=STRING       reformat only lines beginning with STRING,\n\
index c741da2..e235865 100644 (file)
@@ -70,11 +70,10 @@ Usage: %s [OPTION]... [FILE]...\n\
       fputs (_("\
 Wrap input lines in each FILE (standard input by default), writing to\n\
 standard output.\n\
-\n\
-"), stdout);
-      fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       fputs (_("\
   -b, --bytes         count bytes rather than columns\n\
   -s, --spaces        break at spaces\n\
index cf84a95..306c1b8 100644 (file)
@@ -110,11 +110,10 @@ Usage: %s [OPTION]... [FILE]...\n\
 Print the first 10 lines of each FILE to standard output.\n\
 With more than one FILE, precede each with a header giving the file name.\n\
 With no FILE, or when FILE is -, read standard input.\n\
-\n\
-"), stdout);
-      fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       fputs (_("\
   -c, --bytes=[-]K         print the first K bytes of each file;\n\
                              with the leading '-', print all but the last\n\
index cefee0c..55333c2 100644 (file)
@@ -608,11 +608,10 @@ like yum(1) or apt-get(1).\n\
 In the first three forms, copy SOURCE to DEST or multiple SOURCE(s) to\n\
 the existing DIRECTORY, while setting permission modes and owner/group.\n\
 In the 4th form, create all components of the given DIRECTORY(ies).\n\
-\n\
-"), stdout);
-      fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       fputs (_("\
       --backup[=CONTROL]  make a backup of each existing destination file\n\
   -b                  like --backup but does not accept an argument\n\
index 76f013c..d1b836b 100644 (file)
@@ -81,11 +81,10 @@ Usage: %s [-s SIGNAL | -SIGNAL] PID...\n\
               program_name, program_name, program_name);
       fputs (_("\
 Send signals to processes, or list signals.\n\
-\n\
-"), stdout);
-      fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       fputs (_("\
   -s, --signal=SIGNAL, -SIGNAL\n\
                    specify the name or number of the signal to be sent\n\
index c85fc96..e6c01b3 100644 (file)
--- a/src/ln.c
+++ b/src/ln.c
@@ -387,11 +387,10 @@ By default, each destination (name of new link) should not already exist.\n\
 When creating hard links, each TARGET must exist.  Symbolic links\n\
 can hold arbitrary text; if later resolved, a relative link is\n\
 interpreted in relation to its parent directory.\n\
-\n\
-"), stdout);
-      fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       fputs (_("\
       --backup[=CONTROL]      make a backup of each existing destination file\n\
   -b                          like --backup but does not accept an argument\n\
index 37f6109..f1ed43b 100644 (file)
--- a/src/ls.c
+++ b/src/ls.c
@@ -4721,11 +4721,10 @@ usage (int status)
       fputs (_("\
 List information about the FILEs (the current directory by default).\n\
 Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.\n\
-\n\
-"), stdout);
-      fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       fputs (_("\
   -a, --all                  do not ignore entries starting with .\n\
   -A, --almost-all           do not list implied . and ..\n\
index 5f49395..a94f96e 100644 (file)
@@ -56,11 +56,10 @@ usage (int status)
       printf (_("Usage: %s [OPTION]... DIRECTORY...\n"), program_name);
       fputs (_("\
 Create the DIRECTORY(ies), if they do not already exist.\n\
-\n\
-"), stdout);
-      fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       fputs (_("\
   -m, --mode=MODE   set file mode (as in chmod), not a=rwx - umask\n\
   -p, --parents     no error if existing, make parent directories as needed\n\
index 06ce5e9..76291e5 100644 (file)
@@ -51,11 +51,10 @@ usage (int status)
       printf (_("Usage: %s [OPTION]... NAME...\n"), program_name);
       fputs (_("\
 Create named pipes (FIFOs) with the given NAMEs.\n\
-\n\
-"), stdout);
-      fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       fputs (_("\
   -m, --mode=MODE    set file permission bits to MODE, not a=rw - umask\n\
 "), stdout);
index 14fcec7..7cfc708 100644 (file)
@@ -53,11 +53,10 @@ usage (int status)
               program_name);
       fputs (_("\
 Create the special file NAME of the given TYPE.\n\
-\n\
-"), stdout);
-      fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       fputs (_("\
   -m, --mode=MODE    set file permission bits to MODE, not a=rw - umask\n\
 "), stdout);
index cb5cb32..a5e8e08 100644 (file)
--- a/src/mv.c
+++ b/src/mv.c
@@ -291,11 +291,10 @@ Usage: %s [OPTION]... [-T] SOURCE DEST\n\
               program_name, program_name, program_name);
       fputs (_("\
 Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.\n\
-\n\
-"), stdout);
-      fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       fputs (_("\
       --backup[=CONTROL]       make a backup of each existing destination file\
 \n\
index ce2b6e7..04fd3bf 100644 (file)
@@ -74,10 +74,14 @@ usage (int status)
 Run COMMAND with an adjusted niceness, which affects process scheduling.\n\
 With no COMMAND, print the current niceness.  Niceness values range from\n\
 %d (most favorable to the process) to %d (least favorable to the process).\n\
-\n\
-  -n, --adjustment=N   add integer N to the niceness (default 10)\n\
 "),
               - NZERO, NZERO - 1);
+
+      emit_mandatory_arg_note ();
+
+      fputs (_("\
+  -n, --adjustment=N   add integer N to the niceness (default 10)\n\
+"), stdout);
       fputs (HELP_OPTION_DESCRIPTION, stdout);
       fputs (VERSION_OPTION_DESCRIPTION, stdout);
       printf (USAGE_BUILTIN_WARNING, PROGRAM_NAME);
index a701340..96716aa 100644 (file)
--- a/src/nl.c
+++ b/src/nl.c
@@ -179,11 +179,10 @@ Usage: %s [OPTION]... [FILE]...\n\
       fputs (_("\
 Write each FILE to standard output, with line numbers added.\n\
 With no FILE, or when FILE is -, read standard input.\n\
-\n\
-"), stdout);
-      fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       fputs (_("\
   -b, --body-numbering=STYLE      use STYLE for numbering body lines\n\
   -d, --section-delimiter=CC      use CC for separating logical pages\n\
index e7ec59a..ffccd74 100644 (file)
--- a/src/od.c
+++ b/src/od.c
@@ -311,11 +311,10 @@ An OFFSET operand means -j OFFSET.  LABEL is the pseudo-address\n\
 at first byte printed, incremented when dump is progressing.\n\
 For OFFSET and LABEL, a 0x or 0X prefix indicates hexadecimal;\n\
 suffixes may be . for octal and b for multiply by 512.\n\
-\n\
-"), stdout);
-      fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       fputs (_("\
   -A, --address-radix=RADIX   output format for file offsets.  RADIX is one\n\
                                 of [doxn], for Decimal, Octal, Hex or None\n\
index a48eda8..bc9fa76 100644 (file)
@@ -440,11 +440,10 @@ Usage: %s [OPTION]... [FILE]...\n\
 Write lines consisting of the sequentially corresponding lines from\n\
 each FILE, separated by TABs, to standard output.\n\
 With no FILE, or when FILE is -, read standard input.\n\
-\n\
-"), stdout);
-      fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       fputs (_("\
   -d, --delimiters=LIST   reuse characters from LIST instead of TABs\n\
   -s, --serial            paste one file at a time instead of in parallel\n\
index ac6ec50..f4b0b69 100644 (file)
--- a/src/pr.c
+++ b/src/pr.c
@@ -2756,11 +2756,10 @@ Usage: %s [OPTION]... [FILE]...\n\
 
       fputs (_("\
 Paginate or columnate FILE(s) for printing.\n\
-\n\
-"), stdout);
-      fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       fputs (_("\
   +FIRST_PAGE[:LAST_PAGE], --pages=FIRST_PAGE[:LAST_PAGE]\n\
                     begin [stop] printing with page FIRST_[LAST_]PAGE\n\
index fb28b0e..f993673 100644 (file)
--- a/src/ptx.c
+++ b/src/ptx.c
@@ -1820,11 +1820,10 @@ Usage: %s [OPTION]... [INPUT]...   (without -G)\n\
               program_name, program_name);
       fputs (_("\
 Output a permuted index, including context, of the words in the input files.\n\
-\n\
-"), stdout);
-      fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       fputs (_("\
   -A, --auto-reference           output automatically generated references\n\
   -G, --traditional              behave more like System V 'ptx'\n\
index 5548776..8a0b34e 100644 (file)
@@ -87,7 +87,11 @@ Usage: %s CONTEXT COMMAND [args]\n\
       fputs (_("\
 Run a program in a different security context.\n\
 With neither CONTEXT nor COMMAND, print the current security context.\n\
-\n\
+"), stdout);
+
+      emit_mandatory_arg_note ();
+
+      fputs (_("\
   CONTEXT            Complete security context\n\
   -c, --compute      compute process transition context before modifying\n\
   -t, --type=TYPE    type (for same role as parent)\n\
index e1b467c..22e5ec5 100644 (file)
--- a/src/seq.c
+++ b/src/seq.c
@@ -72,7 +72,11 @@ Usage: %s [OPTION]... LAST\n\
 "), program_name, program_name, program_name);
       fputs (_("\
 Print numbers from FIRST to LAST, in steps of INCREMENT.\n\
-\n\
+"), stdout);
+
+      emit_mandatory_arg_note ();
+
+      fputs (_("\
   -f, --format=FORMAT      use printf style floating-point FORMAT\n\
   -s, --separator=STRING   use STRING to separate numbers (default: \\n)\n\
   -w, --equal-width        equalize width by padding with leading zeroes\n\
index 3b5bd3f..9b869cd 100644 (file)
@@ -148,11 +148,10 @@ usage (int status)
       fputs (_("\
 Overwrite the specified FILE(s) repeatedly, in order to make it harder\n\
 for even very expensive hardware probing to recover the data.\n\
-\n\
-"), stdout);
-      fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       printf (_("\
   -f, --force    change permissions to allow writing if necessary\n\
   -n, --iterations=N  overwrite N times instead of the default (%d)\n\
index 09d245a..71ac3e6 100644 (file)
@@ -53,11 +53,10 @@ Usage: %s [OPTION]... [FILE]\n\
               program_name, program_name, program_name);
       fputs (_("\
 Write a random permutation of the input lines to standard output.\n\
-\n\
-"), stdout);
-      fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       fputs (_("\
   -e, --echo                treat each ARG as an input line\n\
   -i, --input-range=LO-HI   treat each number LO through HI as an input line\n\
index 43f8f51..7410abc 100644 (file)
@@ -398,11 +398,10 @@ Usage: %s [OPTION]... [FILE]...\n\
               program_name, program_name);
       fputs (_("\
 Write sorted concatenation of all FILE(s) to standard output.\n\
-\n\
-"), stdout);
-      fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       fputs (_("\
 Ordering options:\n\
 \n\
index 9774cc6..e5e75f0 100644 (file)
@@ -209,11 +209,10 @@ Usage: %s [OPTION]... [INPUT [PREFIX]]\n\
 Output fixed-size pieces of INPUT to PREFIXaa, PREFIXab, ...; default\n\
 size is 1000 lines, and default PREFIX is 'x'.  With no INPUT, or when INPUT\n\
 is -, read standard input.\n\
-\n\
-"), stdout);
-      fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       fprintf (stdout, _("\
   -a, --suffix-length=N   generate suffixes of length N (default %d)\n\
       --additional-suffix=SUFFIX  append an additional SUFFIX to file names.\n\
index 92567ba..dd210d1 100644 (file)
@@ -1349,7 +1349,11 @@ usage (int status)
       printf (_("Usage: %s [OPTION]... FILE...\n"), program_name);
       fputs (_("\
 Display file or file system status.\n\
-\n\
+"), stdout);
+
+      emit_mandatory_arg_note ();
+
+      fputs (_("\
   -L, --dereference     follow links\n\
   -f, --file-system     display file system status instead of file status\n\
 "), stdout);
index bdea0b1..38e9bee 100644 (file)
@@ -90,11 +90,10 @@ usage (int status)
       printf (_("Usage: %s OPTION... COMMAND\n"), program_name);
       fputs (_("\
 Run COMMAND, with modified buffering operations for its standard streams.\n\
-\n\
-"), stdout);
-      fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       fputs (_("\
   -i, --input=MODE   adjust standard input stream buffering\n\
   -o, --output=MODE  adjust standard output stream buffering\n\
index 578696c..fe0f22f 100644 (file)
@@ -515,7 +515,11 @@ Usage: %s [-F DEVICE | --file=DEVICE] [SETTING]...\n\
               program_name, program_name, program_name);
       fputs (_("\
 Print or change terminal characteristics.\n\
-\n\
+"), stdout);
+
+      emit_mandatory_arg_note ();
+
+      fputs (_("\
   -a, --all          print all current settings in human-readable form\n\
   -g, --save         print all current settings in a stty-readable form\n\
   -F, --file=DEVICE  open and use the specified DEVICE instead of stdin\n\
index a13a566..1677999 100644 (file)
@@ -539,6 +539,14 @@ is_nul (const char *buf, size_t bufsize)
   )
 
 static inline void
+emit_mandatory_arg_note (void)
+{
+  fputs (_("\n\
+Mandatory arguments to long options are mandatory for short options too.\n\
+"), stdout);
+}
+
+static inline void
 emit_size_note (void)
 {
   fputs (_("\n\
index 20a45bf..c6a8cf6 100644 (file)
--- a/src/tac.c
+++ b/src/tac.c
@@ -137,11 +137,10 @@ Usage: %s [OPTION]... [FILE]...\n\
       fputs (_("\
 Write each FILE to standard output, last line first.\n\
 With no FILE, or when FILE is -, read standard input.\n\
-\n\
-"), stdout);
-      fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       fputs (_("\
   -b, --before             attach the separator before instead of after\n\
   -r, --regex              interpret the separator as a regular expression\n\
index ba8443c..ca851ee 100644 (file)
@@ -263,11 +263,10 @@ Usage: %s [OPTION]... [FILE]...\n\
 Print the last %d lines of each FILE to standard output.\n\
 With more than one FILE, precede each with a header giving the file name.\n\
 With no FILE, or when FILE is -, read standard input.\n\
-\n\
 "), DEFAULT_N_LINES);
-     fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
-"), stdout);
+
+      emit_mandatory_arg_note ();
+
      fputs (_("\
   -c, --bytes=K            output the last K bytes; alternatively, use -c +K\n\
                            to output bytes starting with the Kth of each file\n\
index 1598dd2..b163a0e 100644 (file)
@@ -213,9 +213,10 @@ Usage: %s [OPTION] DURATION COMMAND [ARG]...\n\
 
       fputs (_("\
 Start COMMAND, and kill it if still running after DURATION.\n\
-\n\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       fputs (_("\
       --preserve-status\n\
                  exit with the same status as COMMAND, even when the\n\
index d4e4bff..2806ef7 100644 (file)
@@ -218,11 +218,10 @@ is supplied.\n\
 \n\
 A FILE argument string of - is handled specially and causes touch to\n\
 change the times of the file associated with standard output.\n\
-\n\
-"), stdout);
-      fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       fputs (_("\
   -a                     change only the access time\n\
   -c, --no-create        do not create any files\n\
index bb095fe..44ff1cf 100644 (file)
@@ -102,11 +102,10 @@ A FILE argument that does not exist is created.\n\
 If a FILE is larger than the specified size, the extra data is lost.\n\
 If a FILE is shorter, it is extended and the extended part (hole)\n\
 reads as zero bytes.\n\
-\n\
-"), stdout);
-      fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       fputs (_("\
   -c, --no-create        do not create any files\n\
 "), stdout);
index 1fcb0fd..1803cd5 100644 (file)
@@ -117,11 +117,10 @@ Usage: %s [OPTION]... [FILE]...\n\
       fputs (_("\
 Convert blanks in each FILE to tabs, writing to standard output.\n\
 With no FILE, or when FILE is -, read standard input.\n\
-\n\
-"), stdout);
-      fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
       fputs (_("\
   -a, --all        convert all blanks, instead of just initial blanks\n\
       --first-only  convert only leading sequences of blanks (overrides -a)\n\
index 7073958..5efdad7 100644 (file)
@@ -140,11 +140,10 @@ Filter adjacent matching lines from INPUT (or standard input),\n\
 writing to OUTPUT (or standard output).\n\
 \n\
 With no options, matching lines are merged to the first occurrence.\n\
-\n\
-"), stdout);
-     fputs (_("\
-Mandatory arguments to long options are mandatory for short options too.\n\
 "), stdout);
+
+      emit_mandatory_arg_note ();
+
      fputs (_("\
   -c, --count           prefix lines by the number of occurrences\n\
   -d, --repeated        only print duplicate lines\n\