[PATCH] vsh: Move 'vshReadlineOptionsGenerator' out of '#if WITH_READLINE'

Peter Krempa posted 1 patch 2 years, 7 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/9d26af5e5b431eab364a0b36152cc51897ef641c.1631869294.git.pkrempa@redhat.com
tools/vsh.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
[PATCH] vsh: Move 'vshReadlineOptionsGenerator' out of '#if WITH_READLINE'
Posted by Peter Krempa 2 years, 7 months ago
It's now also used in vshCompleteHelpCommand which is outside of the
conditionally compiled code.

Fixes: 80f70c74a7
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---

Pushed under the build-fix rule.

 tools/vsh.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/tools/vsh.c b/tools/vsh.c
index cf24586b25..9057310077 100644
--- a/tools/vsh.c
+++ b/tools/vsh.c
@@ -2543,17 +2543,12 @@ vshTreePrint(vshControl *ctl, vshTreeLookup lookup, void *opaque,
     return ret;
 }

-#if WITH_READLINE
-
-/* -----------------
- * Readline stuff
- * -----------------
- */

 /**
  * vshReadlineCommandGenerator:
  *
- * Generator function for command completion.
+ * Generator function for command completion. Used also for completing the
+ * '--command' option of the 'help' command.
  *
  * Returns a string list of all commands, or NULL on failure.
  */
@@ -2590,6 +2585,15 @@ vshReadlineCommandGenerator(void)
     return g_steal_pointer(&ret);
 }

+
+#if WITH_READLINE
+
+/* -----------------
+ * Readline stuff
+ * -----------------
+ */
+
+
 static char **
 vshReadlineOptionsGenerator(const vshCmdDef *cmd,
                             vshCmd *last)
-- 
2.31.1