diff options
author | Sascha Hauer <sha@pengutronix.de> | 2009-10-17 12:44:19 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-10-19 10:18:52 +0200 |
commit | 87e01f28ccc85474e18e1218c9d84f98e2e8977d (patch) | |
tree | c1918930683559d745dcc955d9572b5f568a02f5 /common | |
parent | 0ecf7f1aeb906e3b30500080fbc4e1d1b770f1a2 (diff) | |
download | barebox-87e01f28ccc85474e18e1218c9d84f98e2e8977d.tar.gz barebox-87e01f28ccc85474e18e1218c9d84f98e2e8977d.tar.xz |
commands: return COMMAND_ERROR_USAGE
instead of calling u_boot_cmd_usage in each command to safe
space.
Signed-off-by: Sascha Hauer <sha@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r-- | common/hush.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/common/hush.c b/common/hush.c index 5ff695beb7..70ccd047e3 100644 --- a/common/hush.c +++ b/common/hush.c @@ -1582,10 +1582,8 @@ int run_shell(void) static int do_sh(cmd_tbl_t *cmdtp, int argc, char *argv[]) { - if (argc < 2) { - printf ("Usage:\n%s\n", cmdtp->usage); - return 1; - } + if (argc < 2) + return COMMAND_ERROR_USAGE; return execute_script(argv[1], argc - 1, argv + 1); } @@ -1604,10 +1602,8 @@ U_BOOT_CMD_END static int do_source(cmd_tbl_t *cmdtp, int argc, char *argv[]) { - if (argc < 2) { - printf ("Usage:\n%s\n", cmdtp->usage); - return 1; - } + if (argc < 2) + return COMMAND_ERROR_USAGE; return source_script(argv[1], argc - 1, argv + 1); } |