From: Jo-Philipp Wich Date: Fri, 10 Feb 2017 09:44:17 +0000 (+0100) Subject: cli: implement --lists-dir X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a95a5abea5bce11270ee579a827e376e39925b52;p=oweals%2Fopkg-lede.git cli: implement --lists-dir Add a new flag --lists-dir which allows setting the package feed list directory from command arguments. This is required to be able to use opkg without any configuration file. Signed-off-by: Jo-Philipp Wich --- diff --git a/src/opkg-cl.c b/src/opkg-cl.c index a8e5717..d70ad50 100644 --- a/src/opkg-cl.c +++ b/src/opkg-cl.c @@ -101,6 +101,8 @@ static struct option long_options[] = { {"test", 0, 0, ARGS_OPT_NOACTION}, {"tmp-dir", 1, 0, 't'}, {"tmp_dir", 1, 0, 't'}, + {"lists-dir", 1, 0, 'l'}, + {"lists_dir", 1, 0, 'l'}, {"verbosity", 2, 0, 'V'}, {"version", 0, 0, 'v'}, {0, 0, 0, 0} @@ -115,7 +117,7 @@ args_parse(int argc, char *argv[]) char *tuple, *targ; while (1) { - c = getopt_long_only(argc, argv, "Ad:f:ino:p:t:vV::", + c = getopt_long_only(argc, argv, "Ad:f:ino:p:l:t:vV::", long_options, &option_index); if (c == -1) break; @@ -139,6 +141,9 @@ args_parse(int argc, char *argv[]) case 't': conf->tmp_dir = xstrdup(optarg); break; + case 'l': + conf->lists_dir = xstrdup(optarg); + break; case 'v': printf("opkg version %s\n", VERSION); exit(0); @@ -316,6 +321,8 @@ usage() printf("\t automatically to satisfy dependencies\n"); printf("\t-t Specify tmp-dir.\n"); printf("\t--tmp-dir Specify tmp-dir.\n"); + printf("\t-l Specify lists-dir.\n"); + printf("\t--lists-dir Specify lists-dir.\n"); printf("\n");