]> xenbits.xensource.com Git - libvirt.git/commitdiff
vsh: Drop unused @text arg from readline generators
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 4 Feb 2021 12:46:12 +0000 (13:46 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 10 Feb 2021 10:51:59 +0000 (11:51 +0100)
After previous patches neither vshReadlineCommandGenerator() nor
vshReadlineOptionsGenerator() use prefix that user wants to
complete. The argument is marked as unused in both functions.
Drop it then.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
tools/vsh.c

index 70f780087db88569fabd1accd02a07840ce34d1d..feddc9f13e834399125b1a8872239de880087aa6 100644 (file)
@@ -2557,14 +2557,13 @@ vshTreePrint(vshControl *ctl, vshTreeLookup lookup, void *opaque,
 
 /**
  * vshReadlineCommandGenerator:
- * @text: optional command prefix
  *
  * Generator function for command completion.
  *
  * Returns a string list of all commands, or NULL on failure.
  */
 static char **
-vshReadlineCommandGenerator(const char *text G_GNUC_UNUSED)
+vshReadlineCommandGenerator(void)
 {
     size_t grp_list_index = 0;
     const vshCmdGrp *grp;
@@ -2597,8 +2596,7 @@ vshReadlineCommandGenerator(const char *text G_GNUC_UNUSED)
 }
 
 static char **
-vshReadlineOptionsGenerator(const char *text G_GNUC_UNUSED,
-                            const vshCmdDef *cmd,
+vshReadlineOptionsGenerator(const vshCmdDef *cmd,
                             vshCmd *last)
 {
     size_t list_index = 0;
@@ -2742,9 +2740,9 @@ vshReadlineParse(const char *text, int state)
         opt = vshReadlineCommandFindOpt(partial);
 
         if (!cmd) {
-            list = vshReadlineCommandGenerator(text);
+            list = vshReadlineCommandGenerator();
         } else if (!opt || opt->type == VSH_OT_BOOL) {
-            list = vshReadlineOptionsGenerator(text, cmd, partial);
+            list = vshReadlineOptionsGenerator(cmd, partial);
         } else if (opt && opt->completer) {
             list = opt->completer(autoCompleteOpaque,
                                   partial,