xbps-{bin,repo,pkgdb}: added -V flag that prints the current XBPS

release version as defined in xbps_api.h.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091018084204-1xzyptqkjm5dwfjc
This commit is contained in:
Juan RP
2009-10-18 10:42:04 +02:00
parent 866e758dd2
commit fdc561dfb2
3 changed files with 16 additions and 4 deletions

View File

@ -61,6 +61,7 @@ usage(void)
" show\t<pkgname>\n"
" Options shared by all actions:\n"
" -r\t\t<rootdir>\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();