mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-09 03:21:51 +00:00
common: command: Expose a generic helper to auto-complete sub commands
Some commands have a table of sub-commands. With minor adjustments, complete_cmdv() is able to provide auto-completion for sub-commands (it's just about passing the table of commands instead of taking the global one). We rename this function into complete_subcmd() and implement complete_cmdv() as a wrapper around complete_subcmdv(). Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
parent
cbe07ebeaf
commit
6fb61445bb
2 changed files with 19 additions and 4 deletions
|
@ -54,6 +54,9 @@ int _do_help (cmd_tbl_t *cmd_start, int cmd_items, cmd_tbl_t * cmdtp, int
|
|||
flag, int argc, char * const argv[]);
|
||||
cmd_tbl_t *find_cmd(const char *cmd);
|
||||
cmd_tbl_t *find_cmd_tbl (const char *cmd, cmd_tbl_t *table, int table_len);
|
||||
int complete_subcmdv(cmd_tbl_t *cmdtp, int count, int argc,
|
||||
char * const argv[], char last_char, int maxv,
|
||||
char *cmdv[]);
|
||||
|
||||
extern int cmd_usage(const cmd_tbl_t *cmdtp);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue