From 2b4872345ab2b49b521f2d7a70a8ed91dbcf7732 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 3 Feb 2008 04:37:44 +0100 Subject: [PATCH] make use of the history path feature in the cli --- cli.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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; -- 2.41.1