common: command: Expose a generic helper to auto-complete sub commands
authorBoris Brezillon <boris.brezillon@bootlin.com>
Mon, 3 Dec 2018 21:54:19 +0000 (22:54 +0100)
committerTom Rini <trini@konsulko.com>
Tue, 15 Jan 2019 20:28:53 +0000 (15:28 -0500)
commit6fb61445bb28a37397fdce5cb2d3f5ffd0e1a4e4
tree32d40a84b5d768b3517f0eb4f2bdf2e96d7657ba
parentcbe07ebeafb7b67785844830c7562adc4a1f9dbf
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>
common/command.c
include/command.h