1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-09 01:18:00 +03:00

virsh: Add interface mac completion to iface-name command

Signed-off-by: Lin Ma <lma@suse.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Lin Ma 2020-11-10 17:50:56 +08:00 committed by Michal Privoznik
parent 9b751469ea
commit bfb82029a1
3 changed files with 15 additions and 0 deletions

View File

@ -73,3 +73,13 @@ virshInterfaceNameCompleter(vshControl *ctl,
{
return virshInterfaceStringHelper(ctl, cmd, flags, virInterfaceGetName);
}
char **
virshInterfaceMacCompleter(vshControl *ctl,
const vshCmd *cmd,
unsigned int flags)
{
return virshInterfaceStringHelper(ctl, cmd, flags,
virInterfaceGetMACString);
}

View File

@ -25,3 +25,7 @@
char ** virshInterfaceNameCompleter(vshControl *ctl,
const vshCmd *cmd,
unsigned int flags);
char ** virshInterfaceMacCompleter(vshControl *ctl,
const vshCmd *cmd,
unsigned int flags);

View File

@ -404,6 +404,7 @@ static const vshCmdOptDef opts_interface_name[] = {
{.name = "interface",
.type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.completer = virshInterfaceMacCompleter,
.help = N_("interface mac")
},
{.name = NULL}