diff options
author | Sami Kerola | 2011-08-28 12:01:51 +0200 |
---|---|---|
committer | Sami Kerola | 2011-09-10 19:37:37 +0200 |
commit | cf1377a4314b91f63f05fe1f9dd565166607f348 (patch) | |
tree | 513578e792b3317061cb44947559053a1a01ab10 /sys-utils/setarch.c | |
parent | setarch: move options struct to function scope (diff) | |
download | kernel-qcow2-util-linux-cf1377a4314b91f63f05fe1f9dd565166607f348.tar.gz kernel-qcow2-util-linux-cf1377a4314b91f63f05fe1f9dd565166607f348.tar.xz kernel-qcow2-util-linux-cf1377a4314b91f63f05fe1f9dd565166607f348.zip |
setarch: use program_invocation_short_name
Trust that the c.h is setting program name correctly.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'sys-utils/setarch.c')
-rw-r--r-- | sys-utils/setarch.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/sys-utils/setarch.c b/sys-utils/setarch.c index 865867075..1469f3672 100644 --- a/sys-utils/setarch.c +++ b/sys-utils/setarch.c @@ -89,13 +89,8 @@ enum { static void __attribute__((__noreturn__)) show_help(void) { - const char *p = program_invocation_short_name; - - if (!*p) - p = "setarch"; - printf(_("Usage: %s%s [options] [program [program arguments]]\n\nOptions:\n"), - p, !strcmp(p, "setarch") ? " <arch>" : ""); + program_invocation_short_name, !strcmp(program_invocation_short_name, "setarch") ? " <arch>" : ""); printf(_( " -h, --help displays this help text\n" @@ -122,13 +117,7 @@ show_help(void) static void __attribute__((__noreturn__)) show_usage(const char *s) { - const char *p = program_invocation_short_name; - - if (!*p) - p = "setarch"; - - fprintf(stderr, _("%s: %s\nTry `%s --help' for more information.\n"), p, s, p); - exit(EXIT_FAILURE); + errx(EXIT_FAILURE, _("%s\nTry `%s --help' for more information."), s, program_invocation_short_name); } |