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>
diff --git a/common/command.c b/common/command.c
index c396648..3b9ccc9 100644
--- a/common/command.c
+++ b/common/command.c
@@ -38,7 +38,7 @@
U_BOOT_CMD(
version, 1, 1, do_version,
- "version - print monitor version\n",
+ "print monitor version",
NULL
);
@@ -71,7 +71,7 @@
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 @@
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 @@
U_BOOT_CMD(
exit, 2, 1, do_exit,
- "exit - exit script\n",
+ "exit script",
" - exit functionality\n"
);
@@ -277,7 +277,8 @@
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 @@
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 @@
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 @@
#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 @@
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