projects
/
project
/
uci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
12c5b22
)
report errors on partial lookups for show/get in the cli instead of silently falling...
author
Felix Fietkau
<nbd@openwrt.org>
Wed, 27 Aug 2008 14:31:49 +0000
(16:31 +0200)
committer
Felix Fietkau
<nbd@openwrt.org>
Wed, 27 Aug 2008 14:31:49 +0000
(16:31 +0200)
cli.c
patch
|
blob
|
history
diff --git
a/cli.c
b/cli.c
index
1f08100
..
305d9fe
100644
(file)
--- a/
cli.c
+++ b/
cli.c
@@
-202,8
+202,11
@@
static int package_cmd(int cmd, char *tuple)
uci_export(ctx, stdout, ptr.p, true);
break;
case CMD_SHOW:
uci_export(ctx, stdout, ptr.p, true);
break;
case CMD_SHOW:
- if (!(ptr.flags & UCI_LOOKUP_COMPLETE))
+ if (!(ptr.flags & UCI_LOOKUP_COMPLETE)) {
+ ctx->err = UCI_ERR_NOTFOUND;
+ cli_perror();
return 1;
return 1;
+ }
switch(e->type) {
case UCI_TYPE_PACKAGE:
uci_show_package(ptr.p);
switch(e->type) {
case UCI_TYPE_PACKAGE:
uci_show_package(ptr.p);
@@
-340,6
+343,11
@@
static int uci_do_section_cmd(int cmd, int argc, char **argv)
e = ptr.last;
switch(cmd) {
case CMD_GET:
e = ptr.last;
switch(cmd) {
case CMD_GET:
+ if (!(ptr.flags & UCI_LOOKUP_COMPLETE)) {
+ ctx->err = UCI_ERR_NOTFOUND;
+ cli_perror();
+ return 1;
+ }
switch(e->type) {
case UCI_TYPE_SECTION:
printf("%s\n", ptr.s->type);
switch(e->type) {
case UCI_TYPE_SECTION:
printf("%s\n", ptr.s->type);