diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2008-08-13 15:54:53 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2008-08-13 16:29:17 +0200 |
commit | 932b57873db47db89989b86789b216e50a753478 (patch) | |
tree | 45121689cbab9b60340f62e6148405fdbea53163 /common/command.c | |
parent | 0dd24dc17d561fa0a9f8d5b2ffb5c31e1cf7985c (diff) | |
download | barebox-932b57873db47db89989b86789b216e50a753478.tar.gz barebox-932b57873db47db89989b86789b216e50a753478.tar.xz |
move several commands into extra files
move false, true, help, insmod, lsmod, version into extra files
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/command.c')
-rw-r--r-- | common/command.c | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/common/command.c b/common/command.c index c86b0058f5..accaffa4be 100644 --- a/common/command.c +++ b/common/command.c @@ -41,40 +41,6 @@ const char version_string[] = LIST_HEAD(command_list); EXPORT_SYMBOL(command_list); -static int do_version (cmd_tbl_t *cmdtp, int argc, char *argv[]) -{ - printf ("\n%s\n", version_string); - return 0; -} - -U_BOOT_CMD_START(version) - .maxargs = 1, - .cmd = do_version, - .usage = "print monitor version", -U_BOOT_CMD_END - -static int do_true (cmd_tbl_t *cmdtp, int argc, char *argv[]) -{ - return 0; -} - -U_BOOT_CMD_START(true) - .maxargs = 1, - .cmd = do_true, - .usage = "do nothing, successfully", -U_BOOT_CMD_END - -static int do_false (cmd_tbl_t *cmdtp, int argc, char *argv[]) -{ - return 1; -} - -U_BOOT_CMD_START(false) - .maxargs = 1, - .cmd = do_false, - .usage = "do nothing, unsuccessfully", -U_BOOT_CMD_END - #ifdef CONFIG_SHELL_HUSH static int do_exit (cmd_tbl_t *cmdtp, int argc, char *argv[]) @@ -117,51 +83,6 @@ void u_boot_cmd_usage(cmd_tbl_t *cmdtp) } EXPORT_SYMBOL(u_boot_cmd_usage); -/* - * Use puts() instead of printf() to avoid printf buffer overflow - * for long help messages - */ -static int do_help (cmd_tbl_t * cmdtp, int argc, char *argv[]) -{ - if (argc == 1) { /* show list of commands */ - for_each_command(cmdtp) { - if (!cmdtp->usage) - continue; - printf("%10s - %s\n", cmdtp->name, cmdtp->usage); - } - return 0; - } - - /* command help (long version) */ - if ((cmdtp = find_cmd(argv[1])) != NULL) { - u_boot_cmd_usage(cmdtp); - return 0; - } else { - printf ("Unknown command '%s' - try 'help'" - " without arguments for list of all" - " known commands\n\n", argv[1] - ); - return 1; - } -} - -static const __maybe_unused char cmd_help_help[] = -"Show help information (for 'command')\n" -"'help' prints online help for the monitor commands.\n\n" -"Without arguments, it prints a short usage message for all commands.\n\n" -"To get detailed help information for specific commands you can type\n" -"'help' with one or more command names as arguments.\n"; - -static const char *help_aliases[] = { "?", NULL}; - -U_BOOT_CMD_START(help) - .maxargs = 2, - .cmd = do_help, - .aliases = help_aliases, - .usage = "print online help", - U_BOOT_CMD_HELP(cmd_help_help) -U_BOOT_CMD_END - static int compare(struct list_head *a, struct list_head *b) { char *na = (char*)list_entry(a, cmd_tbl_t, list)->name; |