2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2009-10-16 22:36:25 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2000-2009
|
|
|
|
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <command.h>
|
|
|
|
|
2020-05-10 17:40:03 +00:00
|
|
|
static int do_help(struct cmd_tbl *cmdtp, int flag, int argc,
|
|
|
|
char *const argv[])
|
2009-10-16 22:36:25 +00:00
|
|
|
{
|
2016-03-19 08:18:38 +00:00
|
|
|
#ifdef CONFIG_CMDLINE
|
2020-05-10 17:40:03 +00:00
|
|
|
struct cmd_tbl *start = ll_entry_start(struct cmd_tbl, cmd);
|
|
|
|
const int len = ll_entry_count(struct cmd_tbl, cmd);
|
2012-10-12 10:27:04 +00:00
|
|
|
return _do_help(start, len, cmdtp, flag, argc, argv);
|
2016-03-19 08:18:38 +00:00
|
|
|
#else
|
|
|
|
return 0;
|
|
|
|
#endif
|
2009-10-16 22:36:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
U_BOOT_CMD(
|
|
|
|
help, CONFIG_SYS_MAXARGS, 1, do_help,
|
2009-10-16 22:36:26 +00:00
|
|
|
"print command description/usage",
|
|
|
|
"\n"
|
|
|
|
" - print brief description of all commands\n"
|
|
|
|
"help command ...\n"
|
|
|
|
" - print detailed usage of 'command'"
|
2009-10-16 22:36:25 +00:00
|
|
|
);
|
|
|
|
|
2019-07-29 07:24:53 +00:00
|
|
|
#ifdef CONFIG_CMDLINE
|
2023-10-07 19:13:08 +00:00
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
*/
|
2020-05-10 17:40:03 +00:00
|
|
|
ll_entry_declare(struct cmd_tbl, question_mark, cmd) = {
|
2018-12-03 21:54:20 +00:00
|
|
|
"?", CONFIG_SYS_MAXARGS, cmd_always_repeatable, do_help,
|
2009-10-16 22:36:25 +00:00
|
|
|
"alias for 'help'",
|
2009-10-16 22:36:26 +00:00
|
|
|
#ifdef CONFIG_SYS_LONGHELP
|
2009-10-16 22:36:25 +00:00
|
|
|
""
|
|
|
|
#endif /* CONFIG_SYS_LONGHELP */
|
2009-10-16 22:36:26 +00:00
|
|
|
};
|
2019-07-29 07:24:53 +00:00
|
|
|
#endif
|