[libvirt] [v4 1/5] virsh: Add vshCmdCompleter and vshOptCompleter

Tomas Meszaros exo at tty.sk
Tue Sep 10 15:54:26 UTC 2013


completer and completer_flags added to the _vshCmdOptDef
structure so it will be possible for completion generators to
conveniently call option completer functions with desired flags.

---
v4
* merged (*vshCmdCompleter) and (*vshOptCompleter) into (*vshCompleter)
* deleted completer and completer_flags from the vshCmdDef, now using
  only opt completer

 tools/virsh.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/virsh.h b/tools/virsh.h
index b5e2715..f978d94 100644
--- a/tools/virsh.h
+++ b/tools/virsh.h
@@ -148,6 +148,8 @@ typedef struct _vshCmdOptDef vshCmdOptDef;
 typedef struct _vshControl vshControl;
 typedef struct _vshCtrlData vshCtrlData;
 
+typedef char **(*vshCompleter)(unsigned int flags);
+
 /*
  * vshCmdInfo -- name/value pair for information about command
  *
@@ -169,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 */
+    vshCompleter completer;         /* option completer */
+    unsigned int completer_flags;   /* option completer flags */
 };
 
 /*
-- 
1.8.3.1




More information about the libvir-list mailing list