Rather than continually cut-n-paste the strings into each command, create a common macro to be used generically. Note that not all '{.name = "persistent",' entries are replaced, just those that have the common .help string of "make live change persistent". Non replaced instances are unique to the command. Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx> --- tools/virsh-domain.c | 41 +++++++++++++---------------------------- 1 file changed, 13 insertions(+), 28 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index e766ec4..094cccf 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -70,6 +70,12 @@ .help = N_("domain name, id or uuid") \ } \ +#define VSH_DOMAIN_PERSISTENT_OPT_COMMON \ + {.name = "persistent", \ + .type = VSH_OT_BOOL, \ + .help = N_("make live change persistent") \ + } \ + static virDomainPtr virshLookupDomainInternal(vshControl *ctl, const char *cmdname, @@ -218,10 +224,7 @@ static const vshCmdOptDef opts_attach_device[] = { .flags = VSH_OFLAG_REQ, .help = N_("XML file") }, - {.name = "persistent", - .type = VSH_OT_BOOL, - .help = N_("make live change persistent") - }, + VSH_DOMAIN_PERSISTENT_OPT_COMMON, {.name = "config", .type = VSH_OT_BOOL, .help = N_("affect next boot") @@ -381,10 +384,7 @@ static const vshCmdOptDef opts_attach_disk[] = { .type = VSH_OT_BOOL, .help = N_("print XML document rather than attach the disk") }, - {.name = "persistent", - .type = VSH_OT_BOOL, - .help = N_("make live change persistent") - }, + VSH_DOMAIN_PERSISTENT_OPT_COMMON, {.name = "config", .type = VSH_OT_BOOL, .help = N_("affect next boot") @@ -841,10 +841,7 @@ static const vshCmdOptDef opts_attach_interface[] = { .type = VSH_OT_STRING, .help = N_("control domain's outgoing traffics") }, - {.name = "persistent", - .type = VSH_OT_BOOL, - .help = N_("make live change persistent") - }, + VSH_DOMAIN_PERSISTENT_OPT_COMMON, {.name = "config", .type = VSH_OT_BOOL, .help = N_("affect next boot") @@ -10837,10 +10834,7 @@ static const vshCmdOptDef opts_detach_device[] = { .flags = VSH_OFLAG_REQ, .help = N_("XML file") }, - {.name = "persistent", - .type = VSH_OT_BOOL, - .help = N_("make live change persistent") - }, + VSH_DOMAIN_PERSISTENT_OPT_COMMON, {.name = "config", .type = VSH_OT_BOOL, .help = N_("affect next boot") @@ -10934,10 +10928,7 @@ static const vshCmdOptDef opts_update_device[] = { .flags = VSH_OFLAG_REQ, .help = N_("XML file") }, - {.name = "persistent", - .type = VSH_OT_BOOL, - .help = N_("make live change persistent") - }, + VSH_DOMAIN_PERSISTENT_OPT_COMMON, {.name = "config", .type = VSH_OT_BOOL, .help = N_("affect next boot") @@ -11036,10 +11027,7 @@ static const vshCmdOptDef opts_detach_interface[] = { .type = VSH_OT_STRING, .help = N_("MAC address") }, - {.name = "persistent", - .type = VSH_OT_BOOL, - .help = N_("make live change persistent") - }, + VSH_DOMAIN_PERSISTENT_OPT_COMMON, {.name = "config", .type = VSH_OT_BOOL, .help = N_("affect next boot") @@ -11448,10 +11436,7 @@ static const vshCmdOptDef opts_detach_disk[] = { .flags = VSH_OFLAG_REQ, .help = N_("target of disk device") }, - {.name = "persistent", - .type = VSH_OT_BOOL, - .help = N_("make live change persistent") - }, + VSH_DOMAIN_PERSISTENT_OPT_COMMON, {.name = "config", .type = VSH_OT_BOOL, .help = N_("affect next boot") -- 2.5.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list