summaryrefslogtreecommitdiff
path: root/include/command.h
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@bootlin.com>2018-12-03 22:54:19 +0100
committerTom Rini <trini@konsulko.com>2019-01-15 15:28:53 -0500
commit6fb61445bb28a37397fdce5cb2d3f5ffd0e1a4e4 (patch)
tree32d40a84b5d768b3517f0eb4f2bdf2e96d7657ba /include/command.h
parentcbe07ebeafb7b67785844830c7562adc4a1f9dbf (diff)
downloadu-boot-6fb61445bb28a37397fdce5cb2d3f5ffd0e1a4e4.tar.gz
u-boot-6fb61445bb28a37397fdce5cb2d3f5ffd0e1a4e4.tar.bz2
u-boot-6fb61445bb28a37397fdce5cb2d3f5ffd0e1a4e4.zip
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>
Diffstat (limited to 'include/command.h')
-rw-r--r--include/command.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/command.h b/include/command.h
index 200c7a5e9f..89efcecfa9 100644
--- a/include/command.h
+++ b/include/command.h
@@ -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);