Skip to content

Commit

Permalink
add --config option to point at another pacman.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
falconindy committed Nov 16, 2014
1 parent 1f4a917 commit 3857cd0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.pod
Expand Up @@ -41,6 +41,10 @@ boolean AND query and regex is allowed.

Return packages matching the specified targets as package groups.

=item B<--config> <file>

Read from I<file> for alpm initialization instead of I</etc/pacman.conf>.

=item B<-H, --humansize> <size>

Format package sizes in SI units according to I<size>. Valid options are:
Expand Down
9 changes: 7 additions & 2 deletions expac.c
Expand Up @@ -142,7 +142,8 @@ static void usage(void) {
" -d, --delim <string> separator used between packages (default: \"\\n\")\n"
" -l, --listdelim <string> separator used between list elements (default: \" \")\n"
" -p, --file query local files instead of the DB\n"
" -t, --timefmt <fmt> date format passed to strftime (default: \"%%c\")\n\n"
" -t, --timefmt <fmt> date format passed to strftime (default: \"%%c\")\n"
" --config <file> read from <file> 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");
Expand All @@ -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}
};

Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 3857cd0

Please sign in to comment.