From: Sami Kerola Date: Thu, 15 Mar 2012 22:12:30 +0000 (+0100) Subject: partx: add --version option X-Git-Tag: v2.22-rc1~594 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=72bb1cc9323c60d7baa9603d4eb38502e659a78f;p=thirdparty%2Futil-linux.git partx: add --version option Th commit 8275b7326e535c6d745414baca680f03e9eccdf3 added --version to usage() but not as working option. Signed-off-by: Sami Kerola --- diff --git a/partx/partx.c b/partx/partx.c index ddce6fe4e4..0c46af6ebf 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);