mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
vsh: Add completer for '--command' of 'help' command
Wrap 'vshReadlineCommandGenerator' into a function with proper prototype to provide a completer for the help command. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
f20512c414
commit
80f70c74a7
11
tools/vsh.c
11
tools/vsh.c
@ -3026,9 +3026,20 @@ vshDeinit(vshControl *ctl)
|
||||
* Generic commands available to use by any client
|
||||
* -----------------------------------------------
|
||||
*/
|
||||
|
||||
static char **
|
||||
vshCompleteHelpCommand(vshControl *ctl G_GNUC_UNUSED,
|
||||
const vshCmd *cmd G_GNUC_UNUSED,
|
||||
unsigned int completerflags G_GNUC_UNUSED)
|
||||
{
|
||||
return vshReadlineCommandGenerator();
|
||||
}
|
||||
|
||||
|
||||
const vshCmdOptDef opts_help[] = {
|
||||
{.name = "command",
|
||||
.type = VSH_OT_STRING,
|
||||
.completer = vshCompleteHelpCommand,
|
||||
.help = N_("Prints global help, command specific help, or help for a group of related commands")
|
||||
},
|
||||
{.name = NULL}
|
||||
|
Loading…
Reference in New Issue
Block a user