]> xenbits.xensource.com Git - libvirt.git/commitdiff
vsh: Introduce simple version of VSH_ALTERNATIVE_OPTIONS_EXPR
authorPeter Krempa <pkrempa@redhat.com>
Wed, 13 Dec 2023 13:23:45 +0000 (14:23 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 14 Dec 2023 15:06:23 +0000 (16:06 +0100)
VSH_ALTERNATIVE_OPTIONS takes just the name of the options instead of
requiring also the getter functions.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tools/vsh.h

index 377c5947c160aef737b7d93b284215e8d18a6d59..2a1be29b1c7bab7219f8568a12dbe3d609ab5200 100644 (file)
@@ -551,6 +551,10 @@ void vshReadlineHistoryAdd(const char *cmd);
         } \
     } while (0)
 
+#define VSH_ALTERNATIVE_OPTIONS(NAME1, NAME2) \
+    VSH_ALTERNATIVE_OPTIONS_EXPR(NAME1, vshCommandOptBool(cmd, NAME1), \
+                                 NAME2, vshCommandOptBool(cmd, NAME2))
+
 /* Macros to help dealing with required options. */
 
 /* VSH_REQUIRE_OPTION_EXPR: