mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
vsh: Annotate 'required' and 'positional' arguments explicitly
Add 'positional' and 'required' fields to vshCmdOptDef, which will explicitly track the two properties of arguments. To ensure that we have proper coverage, add checks to vshCmddefCheckInternals validating the state of the above flags by infering it from existing data. This conversion will allow us: - remove VSH_OT_DATA in favor of VSH_OT_STRING - use VSH_OT_INT when required both as positional and non-positional - properly annotate which VSH_OT_ARGV are positional and which are not (currently inferred by whether an previous positional option exists) Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
@@ -1568,6 +1568,8 @@ static const vshCmdOptDef opts_snapshot_dumpxml[] = {
|
||||
VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_HAS_SNAPSHOT),
|
||||
{.name = "snapshotname",
|
||||
.type = VSH_OT_DATA,
|
||||
.positional = true,
|
||||
.required = true,
|
||||
.flags = VSH_OFLAG_REQ,
|
||||
.help = N_("snapshot name"),
|
||||
.completer = virshSnapshotNameCompleter,
|
||||
|
||||
Reference in New Issue
Block a user