projects
/
project
/
uci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
96d3536
)
make use of the history path feature in the cli
author
Felix Fietkau
<nbd@openwrt.org>
Sun, 3 Feb 2008 03:37:44 +0000
(
04:37
+0100)
committer
Felix Fietkau
<nbd@openwrt.org>
Sun, 3 Feb 2008 03:37:44 +0000
(
04:37
+0100)
cli.c
patch
|
blob
|
history
diff --git
a/cli.c
b/cli.c
index
845fc2a
..
45a105a
100644
(file)
--- 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-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 <path> add a search path for config change files\n"
+ "\t-P <path> 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"
"\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;
}
return 1;
}
- while((c = getopt(argc, argv, "
mf:sSnN
q")) != -1) {
+ while((c = getopt(argc, argv, "
f:mnNp:P:sS
q")) != -1) {
switch(c) {
case 'f':
input = fopen(optarg, "r");
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 '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;
case 'q':
flags |= CLI_FLAG_QUIET;
break;