diff --git a/tools/virsh-completer-interface.c b/tools/virsh-completer-interface.c index 1aea7e03c5..1eea2d462a 100644 --- a/tools/virsh-completer-interface.c +++ b/tools/virsh-completer-interface.c @@ -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); +} diff --git a/tools/virsh-completer-interface.h b/tools/virsh-completer-interface.h index 893dee5a6b..733f18cb88 100644 --- a/tools/virsh-completer-interface.h +++ b/tools/virsh-completer-interface.h @@ -25,3 +25,7 @@ char ** virshInterfaceNameCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags); + +char ** virshInterfaceMacCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int flags); diff --git a/tools/virsh-interface.c b/tools/virsh-interface.c index 8cdbc6e85f..ae2b52bfc3 100644 --- a/tools/virsh-interface.c +++ b/tools/virsh-interface.c @@ -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}