xbps-{bin,repo}: new -o flag for the 'show' target, to print specific objs value.

This commit is contained in:
Juan RP
2011-10-29 08:17:54 +02:00
parent 549b5e2e36
commit 1c4d486396
11 changed files with 145 additions and 57 deletions

View File

@@ -90,13 +90,13 @@ main(int argc, char **argv)
struct xbps_handle *xhp;
struct xferstat xfer;
prop_dictionary_t pkgd;
const char *rootdir, *cachedir, *confdir;
const char *rootdir, *cachedir, *confdir, *option;
int c, rv = 0;
bool debug = false;
rootdir = cachedir = confdir = NULL;
rootdir = cachedir = confdir = option = NULL;
while ((c = getopt(argc, argv, "C:c:dr:V")) != -1) {
while ((c = getopt(argc, argv, "C:c:do:r:V")) != -1) {
switch (c) {
case 'C':
confdir = optarg;
@@ -107,6 +107,9 @@ main(int argc, char **argv)
case 'd':
debug = true;
break;
case 'o':
option = optarg;
break;
case 'r':
/* To specify the root directory */
rootdir = optarg;
@@ -186,7 +189,7 @@ main(int argc, char **argv)
if (argc != 2)
usage(xhp);
rv = show_pkg_info_from_repolist(argv[1]);
rv = show_pkg_info_from_repolist(argv[1], option);
if (rv == ENOENT) {
xbps_printf("Unable to locate package "
"`%s' in repository pool.\n", argv[1]);