g_auto(GStrv) tmp = NULL;
const char *type_str = NULL;
- virCheckFlags(0, NULL);
-
- if (vshCommandOptStringQuiet(ctl, cmd, "type", &type_str) < 0)
- return NULL;
+ virCheckFlags(VIRSH_POOL_TYPE_COMPLETER_COMMA, NULL);
tmp = virshEnumComplete(VIR_STORAGE_POOL_LAST,
virStoragePoolTypeToString);
+ if (!(flags & VIRSH_POOL_TYPE_COMPLETER_COMMA))
+ return g_steal_pointer(&tmp);
+
+ if (vshCommandOptStringQuiet(ctl, cmd, "type", &type_str) < 0)
+ return NULL;
+
return virshCommaStringListComplete(type_str, (const char **)tmp);
}
{.name = "type",
.type = VSH_OT_STRING,
.completer = virshPoolTypeCompleter,
+ .completer_flags = VIRSH_POOL_TYPE_COMPLETER_COMMA,
.help = N_("only list pool of specified type(s) (if supported)")
},
{.name = "details",
{.name = "type",
.type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
+ .completer = virshPoolTypeCompleter,
.help = N_("type of storage pool sources to find")
},
{.name = "host",
{.name = "type",
.type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
+ .completer = virshPoolTypeCompleter,
.help = N_("type of storage pool sources to discover")
},
{.name = "srcSpec",