summaryrefslogtreecommitdiffstats
path: root/misc-utils/namei.c
diff options
context:
space:
mode:
authorKarel Zak2011-08-16 12:33:56 +0200
committerKarel Zak2011-08-16 12:33:56 +0200
commit54f0728944927d919135e1c0af8953206ddcc569 (patch)
treeec2183782c13d53c42dfa6836da8dbf9691145b5 /misc-utils/namei.c
parentmcookie: cleanup usage() (diff)
downloadkernel-qcow2-util-linux-54f0728944927d919135e1c0af8953206ddcc569.tar.gz
kernel-qcow2-util-linux-54f0728944927d919135e1c0af8953206ddcc569.tar.xz
kernel-qcow2-util-linux-54f0728944927d919135e1c0af8953206ddcc569.zip
namei: cleanup usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils/namei.c')
-rw-r--r--misc-utils/namei.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/misc-utils/namei.c b/misc-utils/namei.c
index e192f58c1..752c0c183 100644
--- a/misc-utils/namei.c
+++ b/misc-utils/namei.c
@@ -400,28 +400,29 @@ print_namei(struct namei *nm, char *path)
return 0;
}
-static void
-usage(int rc)
+static void usage(int rc)
{
const char *p = program_invocation_short_name;
+ FILE *out = rc == EXIT_FAILURE ? stderr : stdout;
if (!*p)
p = "namei";
- printf(_("\nUsage: %s [options] pathname [pathname ...]\n"), p);
- printf(_("\nOptions:\n"));
-
- printf(_(
- " -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"
- " -m, --modes show the mode bits of each file\n"
- " -o, --owners show owner and group name of each file\n"
- " -l, --long use a long listing format (-m -o -v) \n"
- " -n, --nosymlinks don't follow symlinks\n"
- " -v, --vertical vertical align of modes and owners\n"));
-
- printf(_("\nFor more information see namei(1).\n"));
+ fputs(_("\nUsage:\n"), out);
+ fprintf(out,
+ _(" %s [options] pathname [pathname ...]\n"), p);
+
+ fputs(_("\nOptions:\n"), 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"
+ " -m, --modes show the mode bits of each file\n"
+ " -o, --owners show owner and group name of each file\n"
+ " -l, --long use a long listing format (-m -o -v) \n"
+ " -n, --nosymlinks don't follow symlinks\n"
+ " -v, --vertical vertical align of modes and owners\n"), out);
+
+ fputs(_("\nFor more information see namei(1).\n"), out);
exit(rc);
}