mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-08-06 15:26:58 +02:00
Add option to disable help command in size constrained systems to save some space. There is also no need to have ifdefs around CMDLINE because all commands depends on it. And also mark cmd_help dependency in test_help.py. Reviewed-by: Peter Robinson <pbrobinson@gmail.com> Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org> Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/c17f825fb8a74e1d1912a3fd09a9a880c84a8bfd.1751286059.git.michal.simek@amd.com
37 lines
964 B
C
37 lines
964 B
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* Copyright 2000-2009
|
|
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
*/
|
|
|
|
#include <command.h>
|
|
|
|
static int do_help(struct cmd_tbl *cmdtp, int flag, int argc,
|
|
char *const argv[])
|
|
{
|
|
struct cmd_tbl *start = ll_entry_start(struct cmd_tbl, cmd);
|
|
const int len = ll_entry_count(struct cmd_tbl, cmd);
|
|
return _do_help(start, len, cmdtp, flag, argc, argv);
|
|
}
|
|
|
|
U_BOOT_CMD(
|
|
help, CONFIG_SYS_MAXARGS, 1, do_help,
|
|
"print command description/usage",
|
|
"\n"
|
|
" - print brief description of all commands\n"
|
|
"help command ...\n"
|
|
" - print detailed usage of 'command'"
|
|
);
|
|
|
|
/*
|
|
* This does not use the U_BOOT_CMD macro as ? can't be used in symbol names
|
|
* nor can we rely on the CONFIG_SYS_LONGHELP helper macro
|
|
*/
|
|
ll_entry_declare(struct cmd_tbl, question_mark, cmd) = {
|
|
"?", CONFIG_SYS_MAXARGS, cmd_always_repeatable, do_help,
|
|
"alias for 'help'",
|
|
#ifdef CONFIG_SYS_LONGHELP
|
|
""
|
|
#endif /* CONFIG_SYS_LONGHELP */
|
|
};
|