提交 e178688f 编写于 作者: J John Ferlan

virsh: Create macro for "file" option

Rather than continually cut/paste the "file" option for pool command
option structures, generate a macro which will commonly define it for
any command.  Then of course use that macro.
上级 cf793b00
...@@ -40,6 +40,13 @@ ...@@ -40,6 +40,13 @@
.help = N_("pool name or uuid") \ .help = N_("pool name or uuid") \
} \ } \
#define VSH_POOL_FILE_OPT_COMMON \
{.name = "file", \
.type = VSH_OT_DATA, \
.flags = VSH_OFLAG_REQ, \
.help = N_("file containing an XML pool description") \
} \
virStoragePoolPtr virStoragePoolPtr
virshCommandOptPoolBy(vshControl *ctl, const vshCmd *cmd, const char *optname, virshCommandOptPoolBy(vshControl *ctl, const vshCmd *cmd, const char *optname,
const char **name, unsigned int flags) const char **name, unsigned int flags)
...@@ -145,11 +152,8 @@ static const vshCmdInfo info_pool_create[] = { ...@@ -145,11 +152,8 @@ static const vshCmdInfo info_pool_create[] = {
}; };
static const vshCmdOptDef opts_pool_create[] = { static const vshCmdOptDef opts_pool_create[] = {
{.name = "file", VSH_POOL_FILE_OPT_COMMON,
.type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("file containing an XML pool description")
},
{.name = NULL} {.name = NULL}
}; };
...@@ -410,11 +414,8 @@ static const vshCmdInfo info_pool_define[] = { ...@@ -410,11 +414,8 @@ static const vshCmdInfo info_pool_define[] = {
}; };
static const vshCmdOptDef opts_pool_define[] = { static const vshCmdOptDef opts_pool_define[] = {
{.name = "file", VSH_POOL_FILE_OPT_COMMON,
.type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.help = N_("file containing an XML pool description")
},
{.name = NULL} {.name = NULL}
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册