diff options
author | Sami Kerola <kerolasa@iki.fi> | 2012-03-15 23:12:30 +0100 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2012-03-30 16:48:12 +0200 |
commit | 72bb1cc9323c60d7baa9603d4eb38502e659a78f (patch) | |
tree | b1f7f9c465bfb847829d5f2113fc82c70dc745b3 /partx | |
parent | 6a801e1a38b7cdbc39981f00ed23734cc42b57ff (diff) | |
download | util-linux-72bb1cc9323c60d7baa9603d4eb38502e659a78f.tar.gz |
partx: add --version option
Th commit 8275b7326e535c6d745414baca680f03e9eccdf3 added --version to
usage() but not as working option.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'partx')
-rw-r--r-- | partx/partx.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/partx/partx.c b/partx/partx.c index ddce6fe4..0c46af6e 100644 --- a/partx/partx.c +++ b/partx/partx.c @@ -659,6 +659,7 @@ int main(int argc, char **argv) { "output", required_argument, NULL, 'o' }, { "pairs", no_argument, NULL, 'P' }, { "help", no_argument, NULL, 'h' }, + { "version", no_argument, NULL, 'V' }, { "verbose", no_argument, NULL, 'v' }, { NULL, 0, NULL, 0 } }; @@ -668,7 +669,7 @@ int main(int argc, char **argv) textdomain(PACKAGE); while ((c = getopt_long(argc, argv, - "abdglrsvn:t:o:Ph", long_opts, NULL)) != -1) { + "abdglrsvn:t:o:PhV", long_opts, NULL)) != -1) { switch(c) { case 'a': @@ -728,6 +729,9 @@ int main(int argc, char **argv) break; case 'h': usage(stdout); + case 'V': + printf(UTIL_LINUX_VERSION); + return EXIT_SUCCESS; case '?': default: usage(stderr); |