[PATCH v2 2/9] virsh: Add vshCmdCompleter and vshOptCompleter

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

 



completer and completer_flags added to the _vshCmdDef and _vshCmdOptDef
structures so it will be possible for completion generators to
conveniently call completer functions with desired flags.
---
 tools/virsh.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tools/virsh.h b/tools/virsh.h
index 466ca2d..064acde 100644
--- a/tools/virsh.h
+++ b/tools/virsh.h
@@ -147,6 +147,9 @@ typedef struct _vshCmdOptDef vshCmdOptDef;
 typedef struct _vshControl vshControl;
 typedef struct _vshCtrlData vshCtrlData;
 
+typedef char **(*vshCmdCompleter)(unsigned int flags);
+typedef char **(*vshOptCompleter)(unsigned int flags);
+
 /*
  * vshCmdInfo -- name/value pair for information about command
  *
@@ -168,6 +171,8 @@ struct _vshCmdOptDef {
     unsigned int flags;         /* flags */
     const char *help;           /* non-NULL help string; or for VSH_OT_ALIAS
                                  * the name of a later public option */
+    vshOptCompleter completer;  /* option completer */
+    unsigned int completer_flags;   /* option completer flags */
 };
 
 /*
@@ -199,6 +204,8 @@ struct _vshCmdDef {
     const vshCmdOptDef *opts;   /* definition of command options */
     const vshCmdInfo *info;     /* details about command */
     unsigned int flags;         /* bitwise OR of VSH_CMD_FLAG */
+    vshCmdCompleter completer;  /* command completer */
+    unsigned int completer_flags;   /* command completer flags */
 };
 
 /*
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[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]