diff --git a/bin/xbps-bin/main.c b/bin/xbps-bin/main.c index fb452fb1..295f89e3 100644 --- a/bin/xbps-bin/main.c +++ b/bin/xbps-bin/main.c @@ -57,7 +57,8 @@ usage(void) " update\t\t\n" " Options shared by all targets:\n" " -r\t\t\n" - " -v\t\t\n" + " -v\t\tShows verbose messages\n" + " -V\t\tPrints the xbps release version\n" " Options used by the (auto)remove and install target:\n" " -f\t\tForce installation or removal of packages.\n" " \t\tBeware with this option if you use autoremove!\n" @@ -93,7 +94,7 @@ main(int argc, char **argv) int c, flags = 0, rv = 0; bool force = false, verbose = false; - while ((c = getopt(argc, argv, "Cfr:v")) != -1) { + while ((c = getopt(argc, argv, "CVfr:v")) != -1) { switch (c) { case 'f': flags |= XBPS_FLAG_FORCE; @@ -107,6 +108,9 @@ main(int argc, char **argv) verbose = true; flags |= XBPS_FLAG_VERBOSE; break; + case 'V': + printf("%s\n", XBPS_RELVER); + exit(EXIT_SUCCESS); case '?': default: usage(); diff --git a/bin/xbps-pkgdb/main.c b/bin/xbps-pkgdb/main.c index a841cc05..e72c56ad 100644 --- a/bin/xbps-pkgdb/main.c +++ b/bin/xbps-pkgdb/main.c @@ -72,6 +72,7 @@ usage(void) "\n" " Options shared by all actions:\n" " -r\t\t\t\n" + " -V\t\tPrints the xbps release version\n" "\n" " Examples:\n" " $ xbps-pkgdb getpkgname foo-2.0\n" @@ -94,7 +95,7 @@ main(int argc, char **argv) bool in_chroot = false; int c, rv = 0; - while ((c = getopt(argc, argv, "ar:")) != -1) { + while ((c = getopt(argc, argv, "Var:")) != -1) { switch (c) { case 'r': /* To specify the root directory */ @@ -103,6 +104,9 @@ main(int argc, char **argv) exit(EXIT_FAILURE); xbps_set_rootdir(root); break; + case 'V': + printf("%s\n", XBPS_RELVER); + exit(EXIT_SUCCESS); case '?': default: usage(); diff --git a/bin/xbps-repo/main.c b/bin/xbps-repo/main.c index 2dff5385..6d5df654 100644 --- a/bin/xbps-repo/main.c +++ b/bin/xbps-repo/main.c @@ -61,6 +61,7 @@ usage(void) " show\t\n" " Options shared by all actions:\n" " -r\t\t\n" + " -V\t\tPrints xbps release version\n" "\n" " Examples:\n" " $ xbps-repo add /path/to/directory\n" @@ -151,13 +152,16 @@ main(int argc, char **argv) char dpkgidx[PATH_MAX], *plist, *root = NULL; int c, rv = 0; - while ((c = getopt(argc, argv, "r:")) != -1) { + while ((c = getopt(argc, argv, "Vr:")) != -1) { switch (c) { case 'r': /* To specify the root directory */ root = optarg; xbps_set_rootdir(root); break; + case 'V': + printf("%s\n", XBPS_RELVER); + exit(EXIT_SUCCESS); case '?': default: usage();