mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-09 03:21:51 +00:00
common: command: Rework the 'cmd is repeatable' logic
The repeatable property is currently attached to the main command and sub-commands have no way to change the repeatable value (the ->repeatable field in sub-command entries is ignored). Replace the ->repeatable field by an extended ->cmd() hook (called ->cmd_rep()) which takes a new int pointer to store the repeatable cap of the command being executed. With this trick, we can let sub-commands decide whether they are repeatable or not. We also patch mmc and dtimg who are testing the ->repeatable field directly (they now use cmd_is_repeatable() instead), and fix the help entry manually since it doesn't use the U_BOOT_CMD() macro. Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
parent
6fb61445bb
commit
80a48dd47e
5 changed files with 84 additions and 12 deletions
|
@ -29,7 +29,7 @@ U_BOOT_CMD(
|
|||
|
||||
/* This does not use the U_BOOT_CMD macro as ? can't be used in symbol names */
|
||||
ll_entry_declare(cmd_tbl_t, question_mark, cmd) = {
|
||||
"?", CONFIG_SYS_MAXARGS, 1, do_help,
|
||||
"?", CONFIG_SYS_MAXARGS, cmd_always_repeatable, do_help,
|
||||
"alias for 'help'",
|
||||
#ifdef CONFIG_SYS_LONGHELP
|
||||
""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue