Re: [PATCH 4/4] virsh: Create completer for help command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/04/2011 02:41 AM, Michal Privoznik wrote:
> This completer returns command names and group keywords as well.
> ---
>  tools/virsh.c |   43 ++++++++++++++++++++++++++++++++++++++++++-
>  1 files changed, 42 insertions(+), 1 deletions(-)
> 
> diff --git a/tools/virsh.c b/tools/virsh.c
> index 6a63363..f30d51c 100644
> --- a/tools/virsh.c
> +++ b/tools/virsh.c
> @@ -712,6 +712,46 @@ complt_listAllDomains(const char *text, int state)
>      return complt_listDomainsFlags(text, state, ACTIVE | INACTIVE);
>  }
>  
> +static char *
> +complt_listCmdsAndGroups(const char *text, int state)

This function is nice,

> @@ -12002,7 +12042,8 @@ static const vshCmdDef virshCmds[] = {
>      {"cd", cmdCd, opts_cd, info_cd, VSH_CMD_FLAG_NOCONNECT, NULL},
>      {"echo", cmdEcho, opts_echo, info_echo, VSH_CMD_FLAG_NOCONNECT, NULL},
>      {"exit", cmdQuit, NULL, info_quit, VSH_CMD_FLAG_NOCONNECT, NULL},
> -    {"help", cmdHelp, opts_help, info_help, VSH_CMD_FLAG_NOCONNECT, NULL},
> +    {"help", cmdHelp, opts_help, info_help,
> +     VSH_CMD_FLAG_NOCONNECT, complt_listCmdsAndGroups},

but rather than tying it to cmdHelp, I think it makes more sense to tie
it to a VSH_OT_COMMAND option type.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]