summaryrefslogtreecommitdiff
path: root/cli.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2008-06-06 20:23:52 +0200
committerFelix Fietkau <nbd@openwrt.org>2008-06-06 20:23:52 +0200
commit1879c8f32327177f5c0ca02c9bf9923c55d9b8b0 (patch)
tree06c9379740112309ff5059540861fa9304e556bb /cli.c
parentc4226c1a45e70346933a1985e159f3eff9d380a5 (diff)
downloaduci-1879c8f32327177f5c0ca02c9bf9923c55d9b8b0.tar.gz
allow the cli to override the confdirv0.4.3
Diffstat (limited to 'cli.c')
-rw-r--r--cli.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/cli.c b/cli.c
index 02a34c0..8227987 100644
--- a/cli.c
+++ b/cli.c
@@ -68,6 +68,7 @@ static void uci_usage(void)
"\trevert <config>[.<section>[.<option>]]\n"
"\n"
"Options:\n"
+ "\t-c <path> set the search path for config files (default: /etc/config)\n"
"\t-f <file> use <file> as input instead of stdin\n"
"\t-m when importing, merge data into an existing package\n"
"\t-n name unnamed sections on export (default)\n"
@@ -478,8 +479,11 @@ int main(int argc, char **argv)
return 1;
}
- while((c = getopt(argc, argv, "f:mnNp:P:sSq")) != -1) {
+ while((c = getopt(argc, argv, "c:f:mnNp:P:sSq")) != -1) {
switch(c) {
+ case 'c':
+ uci_set_confdir(ctx, optarg);
+ break;
case 'f':
input = fopen(optarg, "r");
if (!input) {