From 4eaadb47430f21aee83eb920378be01945845a9a Mon Sep 17 00:00:00 2001 From: Bernhard Voelker Date: Wed, 23 Jan 2013 01:03:38 +0100 Subject: maint: define usage note about mandatory args centrally 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. --- src/env.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/env.c') diff --git a/src/env.c b/src/env.c index 4a3f9246e..c31d1658f 100644 --- 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\ -- cgit v1.2.3-54-g00ecf