]> git.baikalelectronics.ru Git - uboot.git/commit
command: commands: Add macros to declare commands with subcmds
authorBoris Brezillon <boris.brezillon@bootlin.com>
Mon, 3 Dec 2018 21:54:21 +0000 (22:54 +0100)
committerTom Rini <trini@konsulko.com>
Tue, 15 Jan 2019 20:28:54 +0000 (15:28 -0500)
commit3c248047aefc0bbde0523fff29d8c8b59df3b158
tree954992ff69b3a97ff6061a1b6ac927c570303393
parent6e37bb8f7a21084eea386fb7328cb1f008786dbd
command: commands: Add macros to declare commands with subcmds

Most cmd/xxx.c source files expose several commands through a single
entry point. Some of them are doing the sub-command parsing manually in
their do_<cmd>() function, others are declaring a table of sub-commands
and then use find_cmd_tbl() to delegate the request to the sub command
handler.

In either case, the amount of code to do that is not negligible and
repetitive, not to mention that almost no commands are implementing
the auto-completion hook, which means most u-boot commands lack
auto-completion.

Provide several macros to easily define commands exposing sub-commands.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
include/command.h