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

[libvirt] [PATCHv3 2/6] virsh: Add vshCmdCompleter and vshOptCompleter



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


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