From 72bb1cc9323c60d7baa9603d4eb38502e659a78f Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Thu, 15 Mar 2012 23:12:30 +0100 Subject: partx: add --version option Th commit 8275b7326e535c6d745414baca680f03e9eccdf3 added --version to usage() but not as working option. Signed-off-by: Sami Kerola --- partx/partx.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'partx') 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); -- cgit v1.2.3