diff options
author | Sami Kerola | 2011-06-11 15:07:10 +0200 |
---|---|---|
committer | Sami Kerola | 2011-06-25 12:37:04 +0200 |
commit | 64718fe7d9dd038c5d472c24cfa4be09e0bb45f7 (patch) | |
tree | abf2d1fb48402d19e557aae33840d554891f00eb /misc-utils/namei.c | |
parent | login-utils: include fix (diff) | |
download | kernel-qcow2-util-linux-64718fe7d9dd038c5d472c24cfa4be09e0bb45f7.tar.gz kernel-qcow2-util-linux-64718fe7d9dd038c5d472c24cfa4be09e0bb45f7.tar.xz kernel-qcow2-util-linux-64718fe7d9dd038c5d472c24cfa4be09e0bb45f7.zip |
namei: add --version option
Add to namei.1 man also the --help option along with the new
--version.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'misc-utils/namei.c')
-rw-r--r-- | misc-utils/namei.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/misc-utils/namei.c b/misc-utils/namei.c index aacaa10d1..f133e40fa 100644 --- a/misc-utils/namei.c +++ b/misc-utils/namei.c @@ -427,6 +427,7 @@ usage(int rc) 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" @@ -441,6 +442,7 @@ usage(int rc) static const struct option longopts[] = { { "help", 0, 0, 'h' }, + { "version", 0, 0, 'V' }, { "mountpoints",0, 0, 'x' }, { "modes", 0, 0, 'm' }, { "owners", 0, 0, 'o' }, @@ -464,12 +466,16 @@ main(int argc, char **argv) if (argc < 2) usage(EXIT_FAILURE); - while ((c = getopt_long(argc, argv, "+h?lmnovx", longopts, NULL)) != -1) { + while ((c = getopt_long(argc, argv, "+h?Vlmnovx", longopts, NULL)) != -1) { switch(c) { case 'h': case '?': usage(EXIT_SUCCESS); break; + case 'V': + printf(_("%s from %s\n"), program_invocation_short_name, + PACKAGE_STRING); + return EXIT_SUCCESS; case 'l': flags |= (NAMEI_OWNERS | NAMEI_MODES | NAMEI_VERTICAL); break; |