projects
/
project
/
uci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix signed vs unsigned char validation bug
[project/uci.git]
/
cli.c
diff --git
a/cli.c
b/cli.c
index
61afa80
..
36ef6e5
100644
(file)
--- a/
cli.c
+++ b/
cli.c
@@
-26,6
+26,7
@@
static enum {
CLI_FLAG_QUIET = (1 << 1),
CLI_FLAG_NOCOMMIT = (1 << 2),
CLI_FLAG_BATCH = (1 << 3),
CLI_FLAG_QUIET = (1 << 1),
CLI_FLAG_NOCOMMIT = (1 << 2),
CLI_FLAG_BATCH = (1 << 3),
+ CLI_FLAG_SHOW_EXT = (1 << 4),
} flags;
static FILE *input;
} flags;
static FILE *input;
@@
-84,7
+85,7
@@
uci_lookup_section_ref(struct uci_section *s)
struct uci_type_list *ti = type_list;
int maxlen;
struct uci_type_list *ti = type_list;
int maxlen;
- if (!s->anonymous)
+ if (!s->anonymous
|| !(flags & CLI_FLAG_SHOW_EXT)
)
return s->e.name;
/* look up in section type list */
return s->e.name;
/* look up in section type list */
@@
-143,6
+144,7
@@
static void uci_usage(void)
"\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"
+ "\t-X do not use extended syntax on 'show'\n"
"\n",
appname
);
"\n",
appname
);
@@
-592,6
+594,7
@@
int main(int argc, char **argv)
int ret;
int c;
int ret;
int c;
+ flags = CLI_FLAG_SHOW_EXT;
appname = argv[0];
input = stdin;
ctx = uci_alloc_context();
appname = argv[0];
input = stdin;
ctx = uci_alloc_context();
@@
-600,7
+603,7
@@
int main(int argc, char **argv)
return 1;
}
return 1;
}
- while((c = getopt(argc, argv, "c:d:f:mnNp:P:sSq")) != -1) {
+ while((c = getopt(argc, argv, "c:d:f:mnNp:P:sSq
X
")) != -1) {
switch(c) {
case 'c':
uci_set_confdir(ctx, optarg);
switch(c) {
case 'c':
uci_set_confdir(ctx, optarg);
@@
-642,6
+645,9
@@
int main(int argc, char **argv)
case 'q':
flags |= CLI_FLAG_QUIET;
break;
case 'q':
flags |= CLI_FLAG_QUIET;
break;
+ case 'X':
+ flags &= ~CLI_FLAG_SHOW_EXT;
+ break;
default:
uci_usage();
return 0;
default:
uci_usage();
return 0;