mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-05 04:25:19 +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
|
* 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[] = {
|
const vshCmdOptDef opts_help[] = {
|
||||||
{.name = "command",
|
{.name = "command",
|
||||||
.type = VSH_OT_STRING,
|
.type = VSH_OT_STRING,
|
||||||
|
.completer = vshCompleteHelpCommand,
|
||||||
.help = N_("Prints global help, command specific help, or help for a group of related commands")
|
.help = N_("Prints global help, command specific help, or help for a group of related commands")
|
||||||
},
|
},
|
||||||
{.name = NULL}
|
{.name = NULL}
|
||||||
|
Loading…
Reference in New Issue
Block a user