}
return ret;
}
+
+
+char **
+virshNetworkUpdateCommandCompleter(vshControl *ctl G_GNUC_UNUSED,
+ const vshCmd *cmd G_GNUC_UNUSED,
+ unsigned int flags)
+{
+ char **ret = NULL;
+ size_t i;
+
+ virCheckFlags(0, NULL);
+
+ ret = g_new0(char *, VIR_NETWORK_UPDATE_COMMAND_LAST + 1);
+
+ /* The first item in the enum is not accepted by virsh, But there's "add"
+ * which is accepted an is just an alias to "add-last". */
+ ret[0] = g_strdup("add");
+
+ for (i = 1; i < VIR_NETWORK_UPDATE_COMMAND_LAST; i++)
+ ret[i] = g_strdup(virshNetworkUpdateCommandTypeToString(i));
+
+ return ret;
+}
virshNetworkDhcpMacCompleter(vshControl *ctl,
const vshCmd *cmd,
unsigned int flags);
+
+char **
+virshNetworkUpdateCommandCompleter(vshControl *ctl,
+ const vshCmd *cmd,
+ unsigned int flags);
{.name = "command",
.type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
+ .completer = virshNetworkUpdateCommandCompleter,
.help = N_("type of update (add-first, add-last (add), delete, or modify)")
},
{.name = "section",
{.name = NULL}
};
-VIR_ENUM_DECL(virshNetworkUpdateCommand);
VIR_ENUM_IMPL(virshNetworkUpdateCommand,
VIR_NETWORK_UPDATE_COMMAND_LAST,
"none", "modify", "delete", "add-last", "add-first");
extern virshNetworkEventCallback virshNetworkEventCallbacks[];
+VIR_ENUM_DECL(virshNetworkUpdateCommand);
+
extern const vshCmdDef networkCmds[];