[PATCH] virsh: completer for --type of commands find-storage-pool-sources and find-storage-pool-sources-as

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Adam Julis <ajulis@xxxxxxxxxx>
---
 tools/virsh-completer-pool.c | 11 +++++++++++
 tools/virsh-completer-pool.h |  5 +++++
 tools/virsh-pool.c           |  2 ++
 3 files changed, 18 insertions(+)

diff --git a/tools/virsh-completer-pool.c b/tools/virsh-completer-pool.c
index 0600394411..1081e5c10c 100644
--- a/tools/virsh-completer-pool.c
+++ b/tools/virsh-completer-pool.c
@@ -66,6 +66,17 @@ virshStoragePoolNameCompleter(vshControl *ctl,
 }
 
 
+char **
+virshStoragePoolTypeCompleter(vshControl *ctl G_GNUC_UNUSED,
+                              const vshCmd *cmd G_GNUC_UNUSED,
+                              unsigned int flags)
+{
+    virCheckFlags(0, NULL);
+
+    return virshEnumComplete(VIR_STORAGE_POOL_LAST, virStoragePoolTypeToString);
+}
+
+
 char **
 virshPoolEventNameCompleter(vshControl *ctl G_GNUC_UNUSED,
                             const vshCmd *cmd G_GNUC_UNUSED,
diff --git a/tools/virsh-completer-pool.h b/tools/virsh-completer-pool.h
index 059b6ba9e0..5a051d2aeb 100644
--- a/tools/virsh-completer-pool.h
+++ b/tools/virsh-completer-pool.h
@@ -32,6 +32,11 @@ virshPoolEventNameCompleter(vshControl *ctl,
                             const vshCmd *cmd,
                             unsigned int flags);
 
+char **
+virshStoragePoolTypeCompleter(vshControl *ctl,
+                             const vshCmd *cmd,
+                             unsigned int completerflags);
+
 char **
 virshPoolTypeCompleter(vshControl *ctl,
                        const vshCmd *cmd,
diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c
index 36f00cf643..db5cb6306c 100644
--- a/tools/virsh-pool.c
+++ b/tools/virsh-pool.c
@@ -1414,6 +1414,7 @@ static const vshCmdOptDef opts_find_storage_pool_sources_as[] = {
     {.name = "type",
      .type = VSH_OT_DATA,
      .flags = VSH_OFLAG_REQ,
+     .completer = virshStoragePoolTypeCompleter,
      .help = N_("type of storage pool sources to find")
     },
     {.name = "host",
@@ -1501,6 +1502,7 @@ static const vshCmdOptDef opts_find_storage_pool_sources[] = {
     {.name = "type",
      .type = VSH_OT_DATA,
      .flags = VSH_OFLAG_REQ,
+     .completer = virshStoragePoolTypeCompleter,
      .help = N_("type of storage pool sources to discover")
     },
     {.name = "srcSpec",
-- 
2.43.0
_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux