The original "Command failed: Not found" message tends to make people think it's from shell. Make it clear and verbose for the ease of debug.
Signed-off-by: Yousong Zhou <yszhou4t...@gmail.com> --- cli.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/cli.c b/cli.c index e4eb504..760eb47 100644 --- a/cli.c +++ b/cli.c @@ -371,8 +371,13 @@ int main(int argc, char **argv) break; } - if (ret > 0 && !simple_output) - fprintf(stderr, "Command failed: %s\n", ubus_strerror(ret)); + if (ret > 0 && !simple_output) { + fprintf(stderr, "Ubus command failed: %s:", ubus_strerror(ret)); + for (i = 0; i < argc; i++) { + fprintf(stderr, " %s", argv[i]); + } + fprintf(stderr, "\n"); + } else if (ret == -2) usage(progname); -- 1.7.2.5 _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel