diff options
author | Sami Kerola | 2014-09-28 21:51:41 +0200 |
---|---|---|
committer | Karel Zak | 2014-10-01 12:33:26 +0200 |
commit | db433bf737a5fd4e1c7cca5e3603934743eebd1c (patch) | |
tree | de811b6d372bf7cba52535d2d1de770541499b34 /misc-utils | |
parent | textual: use manual tail usage() macro (diff) | |
download | kernel-qcow2-util-linux-db433bf737a5fd4e1c7cca5e3603934743eebd1c.tar.gz kernel-qcow2-util-linux-db433bf737a5fd4e1c7cca5e3603934743eebd1c.tar.xz kernel-qcow2-util-linux-db433bf737a5fd4e1c7cca5e3603934743eebd1c.zip |
textual: use usage() text element macros
Translating these text elements should happen only once, which is
more likely when the text macros are used properly.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'misc-utils')
-rw-r--r-- | misc-utils/getopt.c | 12 | ||||
-rw-r--r-- | misc-utils/look.c | 5 | ||||
-rw-r--r-- | misc-utils/namei.c | 5 | ||||
-rw-r--r-- | misc-utils/uuidd.c | 4 | ||||
-rw-r--r-- | misc-utils/uuidgen.c | 4 | ||||
-rw-r--r-- | misc-utils/wipefs.c | 5 |
6 files changed, 15 insertions, 20 deletions
diff --git a/misc-utils/getopt.c b/misc-utils/getopt.c index 74793ee15..b82b62aa8 100644 --- a/misc-utils/getopt.c +++ b/misc-utils/getopt.c @@ -311,17 +311,15 @@ static void set_shell(const char *new_shell) static void __attribute__ ((__noreturn__)) print_help(void) { - fputs(_("\nUsage:\n"), stderr); - + fputs(USAGE_HEADER, stderr); fprintf(stderr, _( " %1$s optstring parameters\n" " %1$s [options] [--] optstring parameters\n" " %1$s [options] -o|--options optstring [options] [--] parameters\n"), program_invocation_short_name); - fputs(_("\nOptions:\n"), stderr); + fputs(USAGE_OPTIONS, stderr); fputs(_(" -a, --alternative Allow long options starting with single -\n"), stderr); - fputs(_(" -h, --help This small usage guide\n"), stderr); fputs(_(" -l, --longoptions <longopts> Long options to be recognized\n"), stderr); fputs(_(" -n, --name <progname> The name under which errors are reported\n"), stderr); fputs(_(" -o, --options <optstring> Short options to be recognized\n"), stderr); @@ -330,9 +328,9 @@ static void __attribute__ ((__noreturn__)) print_help(void) fputs(_(" -s, --shell <shell> Set shell quoting conventions\n"), stderr); fputs(_(" -T, --test Test for getopt(1) version\n"), stderr); fputs(_(" -u, --unquoted Do not quote the output\n"), stderr); - fputs(_(" -V, --version Output version information\n"), stderr); - fputc('\n', stderr); - + fputs(USAGE_SEPARATOR, stderr); + fputs(USAGE_HELP, stderr); + fputs(USAGE_VERSION, stderr); fprintf(stderr, USAGE_MAN_TAIL("getopt(1)")); exit(PARAMETER_EXIT_CODE); } diff --git a/misc-utils/look.c b/misc-utils/look.c index d519cf6fa..51938f20b 100644 --- a/misc-utils/look.c +++ b/misc-utils/look.c @@ -363,11 +363,10 @@ compare(char *s2, char *s2end) { static void __attribute__ ((__noreturn__)) usage(FILE * out) { - fputs(_("\nUsage:\n"), out), + fputs(USAGE_HEADER, out); fprintf(out, _(" %s [options] string [file]\n"), program_invocation_short_name); - - fputs(_("\nOptions:\n"), out); + fputs(USAGE_OPTIONS, out); fputs(_(" -a, --alternative use alternative dictionary\n" " -d, --alphanum compare only alphanumeric characters\n" " -f, --ignore-case ignore case differences when comparing\n" diff --git a/misc-utils/namei.c b/misc-utils/namei.c index a4496bcaf..ff58c9b4f 100644 --- a/misc-utils/namei.c +++ b/misc-utils/namei.c @@ -424,11 +424,10 @@ static void usage(int rc) if (!*p) p = "namei"; - fputs(_("\nUsage:\n"), out); + fputs(USAGE_HEADER, out); fprintf(out, _(" %s [options] <pathname>...\n"), p); - - fputs(_("\nOptions:\n"), out); + fputs(USAGE_OPTIONS, out); fputs(_(" -h, --help displays this help text\n" " -V, --version output version information and exit\n" " -x, --mountpoints show mount point directories with a 'D'\n" diff --git a/misc-utils/uuidd.c b/misc-utils/uuidd.c index 8909b5178..55aac3534 100644 --- a/misc-utils/uuidd.c +++ b/misc-utils/uuidd.c @@ -68,11 +68,11 @@ struct uuidd_cxt_t { static void __attribute__ ((__noreturn__)) usage(FILE * out) { - fputs(_("\nUsage:\n"), out); + fputs(USAGE_HEADER, out); fprintf(out, _(" %s [options]\n"), program_invocation_short_name); - fputs(_("\nOptions:\n"), out); + fputs(USAGE_OPTIONS, out); fputs(_(" -p, --pid <path> path to pid file\n" " -s, --socket <path> path to socket\n" " -T, --timeout <sec> specify inactivity timeout\n" diff --git a/misc-utils/uuidgen.c b/misc-utils/uuidgen.c index 3883424e9..48c6562fd 100644 --- a/misc-utils/uuidgen.c +++ b/misc-utils/uuidgen.c @@ -28,11 +28,11 @@ extern int optind; static void __attribute__ ((__noreturn__)) usage(FILE * out) { - fputs(_("\nUsage:\n"), out); + fputs(USAGE_HEADER, out); fprintf(out, _(" %s [options]\n"), program_invocation_short_name); - fputs(_("\nOptions:\n"), out); + fputs(USAGE_OPTIONS, out); fputs(_(" -r, --random generate random-based uuid\n" " -t, --time generate time-based uuid\n" " -V, --version output version information and exit\n" diff --git a/misc-utils/wipefs.c b/misc-utils/wipefs.c index 0671bb4d0..70c3f238b 100644 --- a/misc-utils/wipefs.c +++ b/misc-utils/wipefs.c @@ -448,11 +448,10 @@ do_wipe(struct wipe_desc *wp, const char *devname, int flags) static void __attribute__((__noreturn__)) usage(FILE *out) { - fputs(_("\nUsage:\n"), out); + fputs(USAGE_HEADER, out); fprintf(out, _(" %s [options] <device>\n"), program_invocation_short_name); - - fputs(_("\nOptions:\n"), out); + fputs(USAGE_OPTIONS, out); fputs(_(" -a, --all wipe all magic strings (BE CAREFUL!)\n" " -b, --backup create a signature backup in $HOME\n" " -f, --force force erasure\n" |