summaryrefslogtreecommitdiff
path: root/common/command.c
diff options
context:
space:
mode:
authorPeter Tyser <ptyser@xes-inc.com>2009-01-27 18:03:12 -0600
committerWolfgang Denk <wd@denx.de>2009-01-28 08:49:52 +0100
commit2fb2604d5c20beb061b0a94282b7f6eb14d00cb8 (patch)
tree2b78cc5cbc9678d46449d873ef1ac0e02a13f2bc /common/command.c
parent79621bc10ba8b8c45d348994aba5b9e4923cb77b (diff)
Command usage cleanup
Remove command name from all command "usage" fields and update common/command.c to display "name - usage" instead of just "usage". Also remove newlines from command usage fields. Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
Diffstat (limited to 'common/command.c')
-rw-r--r--common/command.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/common/command.c b/common/command.c
index c3966484f9a..3b9ccc9ed08 100644
--- a/common/command.c
+++ b/common/command.c
@@ -38,7 +38,7 @@ do_version (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
U_BOOT_CMD(
version, 1, 1, do_version,
- "version - print monitor version\n",
+ "print monitor version",
NULL
);
@@ -71,7 +71,7 @@ do_echo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
U_BOOT_CMD(
echo, CONFIG_SYS_MAXARGS, 1, do_echo,
- "echo - echo args to console\n",
+ "echo args to console",
"[args..]\n"
" - echo args to console; \\c suppresses newline\n"
);
@@ -203,7 +203,7 @@ do_test (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
U_BOOT_CMD(
test, CONFIG_SYS_MAXARGS, 1, do_test,
- "test - minimal test like /bin/sh\n",
+ "minimal test like /bin/sh",
"[args..]\n"
" - test functionality\n"
);
@@ -222,7 +222,7 @@ do_exit (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
U_BOOT_CMD(
exit, 2, 1, do_exit,
- "exit - exit script\n",
+ "exit script",
" - exit functionality\n"
);
@@ -277,7 +277,8 @@ int do_help (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
return 1;
if (usage == NULL)
continue;
- puts (usage);
+ printf("%-*s- %s\n", CONFIG_SYS_HELP_CMD_WIDTH,
+ cmd_array[i]->name, usage);
}
return 0;
}
@@ -299,7 +300,7 @@ int do_help (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
putc ('\n');
#else /* no long help available */
if (cmdtp->usage)
- puts (cmdtp->usage);
+ printf ("%s - %s\n", cmdtp->name, cmdtp->usage);
#endif /* CONFIG_SYS_LONGHELP */
} else {
printf ("Unknown command '%s' - try 'help'"
@@ -315,7 +316,7 @@ int do_help (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
U_BOOT_CMD(
help, CONFIG_SYS_MAXARGS, 1, do_help,
- "help - print online help\n",
+ "print online help",
"[command ...]\n"
" - show help information (for 'command')\n"
"'help' prints online help for the monitor commands.\n\n"
@@ -328,13 +329,13 @@ U_BOOT_CMD(
#ifdef CONFIG_SYS_LONGHELP
cmd_tbl_t __u_boot_cmd_question_mark Struct_Section = {
"?", CONFIG_SYS_MAXARGS, 1, do_help,
- "? - alias for 'help'\n",
+ "alias for 'help'",
NULL
};
#else
cmd_tbl_t __u_boot_cmd_question_mark Struct_Section = {
"?", CONFIG_SYS_MAXARGS, 1, do_help,
- "? - alias for 'help'\n"
+ "alias for 'help'"
};
#endif /* CONFIG_SYS_LONGHELP */
@@ -381,7 +382,7 @@ cmd_tbl_t *find_cmd (const char *cmd)
void cmd_usage(cmd_tbl_t *cmdtp)
{
- printf("Usage:\n%s\n", cmdtp->usage);
+ printf("Usage:\n%s - %s\n\n", cmdtp->name, cmdtp->usage);
}
#ifdef CONFIG_AUTO_COMPLETE