virsh: Create macro for common "file" option

Rather than continually cut-n-paste the strings into each command,
create a common macro to be used generically. The macro will take a
single argument _helpstr for the less common help string for each
command option.  Note that only file options using "OT_DATA" and
"OFLAG_REQ" will be replace - others are left as is.

Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
John Ferlan
2016-01-09 08:36:29 -05:00
parent 5b42dbed98
commit febf69b5e9
9 changed files with 39 additions and 129 deletions

View File

@@ -142,11 +142,7 @@ static const vshCmdInfo info_network_create[] = {
};
static const vshCmdOptDef opts_network_create[] = {
{.name = "file",
.type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("file containing an XML network description")
},
VIRSH_COMMON_OPT_FILE(N_("file containing an XML network description")),
{.name = NULL}
};
@@ -194,11 +190,7 @@ static const vshCmdInfo info_network_define[] = {
};
static const vshCmdOptDef opts_network_define[] = {
{.name = "file",
.type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("file containing an XML network description")
},
VIRSH_COMMON_OPT_FILE(N_("file containing an XML network description")),
{.name = NULL}
};