X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fuci.git;a=blobdiff_plain;f=cli.c;h=45a105a715320de7a2052a4a098b6532890887a9;hp=845fc2acee988e0ac285ba6d6e8f900d53549cf3;hb=2b4872345ab2b49b521f2d7a70a8ed91dbcf7732;hpb=96d35364c9159c96b164369d0d0c5147b0c73a24;ds=sidebyside diff --git a/cli.c b/cli.c index 845fc2a..45a105a 100644 --- a/cli.c +++ b/cli.c @@ -53,6 +53,8 @@ static void uci_usage(int argc, char **argv) "\t-m when importing, merge data into an existing package\n" "\t-n name unnamed sections on export (default)\n" "\t-N don't name unnamed sections\n" + "\t-p add a search path for config change files\n" + "\t-P add a search path for config change files and use as default\n" "\t-q quiet mode (don't print error messages)\n" "\t-s force strict mode (stop on parser errors, default)\n" "\t-S disable strict mode\n" @@ -316,7 +318,7 @@ int main(int argc, char **argv) return 1; } - while((c = getopt(argc, argv, "mf:sSnNq")) != -1) { + while((c = getopt(argc, argv, "f:mnNp:P:sSq")) != -1) { switch(c) { case 'f': input = fopen(optarg, "r"); @@ -341,6 +343,13 @@ int main(int argc, char **argv) case 'N': ctx->flags &= ~UCI_FLAG_EXPORT_NAME; break; + case 'p': + uci_add_history_path(ctx, optarg); + break; + case 'P': + uci_add_history_path(ctx, ctx->savedir); + uci_set_savedir(ctx, optarg); + break; case 'q': flags |= CLI_FLAG_QUIET; break;