From 3857cd02e80e371747005f358701a463b5365b04 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sun, 16 Nov 2014 17:47:11 -0500 Subject: add --config option to point at another pacman.conf --- README.pod | 4 ++++ expac.c | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.pod b/README.pod index 8e51329..2ac5b79 100644 --- a/README.pod +++ b/README.pod @@ -41,6 +41,10 @@ boolean AND query and regex is allowed. Return packages matching the specified targets as package groups. +=item B<--config> + +Read from I for alpm initialization instead of I. + =item B<-H, --humansize> Format package sizes in SI units according to I. Valid options are: diff --git a/expac.c b/expac.c index ebbaaa6..0f23c01 100644 --- a/expac.c +++ b/expac.c @@ -142,7 +142,8 @@ static void usage(void) { " -d, --delim separator used between packages (default: \"\\n\")\n" " -l, --listdelim separator used between list elements (default: \" \")\n" " -p, --file query local files instead of the DB\n" - " -t, --timefmt date format passed to strftime (default: \"%%c\")\n\n" + " -t, --timefmt date format passed to strftime (default: \"%%c\")\n" + " --config read from for alpm initialization (default: /etc/pacman.conf)\n\n" " -v, --verbose be more verbose\n\n" " -h, --help display this help and exit\n\n" "For more details see expac(1).\n"); @@ -162,6 +163,7 @@ static int parse_options(int argc, char *argv[]) { {"search", no_argument, 0, 's'}, {"timefmt", required_argument, 0, 't'}, {"verbose", no_argument, 0, 'v'}, + {"config", required_argument, 0, 128}, {0, 0, 0, 0} }; @@ -200,7 +202,7 @@ static int parse_options(int argc, char *argv[]) { break; case 'h': usage(); - return 1; + exit(0); case 'p': opt_corpus = CORPUS_FILE; break; @@ -213,6 +215,9 @@ static int parse_options(int argc, char *argv[]) { case 'v': opt_verbose = true; break; + case 128: + opt_config_file = optarg; + break; case '?': return -EINVAL; -- cgit v1.2.3-54-g00ecf