Browse Source

cli: enhance "uci show" command on nonexistent sections and options.

When doing "uci show network.nilsection", the current behaviour is that
uci will emit a error message complaining "Entry not found", then
continue to show all content of the package network itself.  This is
couter-intuition.

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Yousong Zhou 9 years ago
parent
commit
3e26ec5716
1 changed files with 1 additions and 0 deletions
  1. 1 0
      cli.c

+ 1 - 0
cli.c

@@ -314,6 +314,7 @@ static int package_cmd(int cmd, char *tuple)
 		if (!(ptr.flags & UCI_LOOKUP_COMPLETE)) {
 			ctx->err = UCI_ERR_NOTFOUND;
 			cli_perror();
+			goto out;
 		}
 		switch(e->type) {
 			case UCI_TYPE_PACKAGE: