While not useful per-se, it will help checking the available options.
---
test-tool/Makefile.am | 5 ++++-
test-tool/test-tool.c | 9 ++++++++-
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/test-tool/Makefile.am b/test-tool/Makefile.am
index bf4f5a843..2cbd4d1b1 100644
--- a/test-tool/Makefile.am
+++ b/test-tool/Makefile.am
@@ -22,11 +22,14 @@ EXTRA_DIST = libguestfs-test-tool.pod
bin_PROGRAMS = libguestfs-test-tool
man_MANS = libguestfs-test-tool.1
-libguestfs_test_tool_SOURCES = test-tool.c
+libguestfs_test_tool_SOURCES = \
+ ../common/options/display-options.c \
+ test-tool.c
libguestfs_test_tool_CPPFLAGS = \
-I$(top_srcdir)/common/utils -I$(top_builddir)/common/utils \
-I$(top_srcdir)/lib -I$(top_builddir)/lib \
+ -I$(top_srcdir)/common/options -I$(top_builddir)/common/options \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
-DGUESTFS_WARN_DEPRECATED=1 \
-DLOCALEBASEDIR=\""$(datadir)/locale"\"
diff --git a/test-tool/test-tool.c b/test-tool/test-tool.c
index 49e9ab22a..73e084e50 100644
--- a/test-tool/test-tool.c
+++ b/test-tool/test-tool.c
@@ -37,6 +37,7 @@
#include "guestfs.h"
#include "guestfs-utils.h"
+#include "display-options.h"
#include "ignore-value.h"
@@ -81,8 +82,10 @@ main (int argc, char *argv[])
static const char options[] = "t:V?";
static const struct option long_options[] = {
{ "help", 0, 0, '?' },
+ { "long-options", 0, 0, 0 },
{ "qemu", 1, 0, 0 },
{ "qemudir", 1, 0, 0 },
+ { "short-options", 0, 0, 0 },
{ "timeout", 1, 0, 't' },
{ "version", 0, 0, 'V' },
{ 0, 0, 0, 0 }
@@ -103,7 +106,11 @@ main (int argc, char *argv[])
switch (c) {
case 0: /* options which are long only */
- if (STREQ (long_options[option_index].name, "qemu")) {
+ if (STREQ (long_options[option_index].name, "long-options"))
+ display_long_options (long_options);
+ else if (STREQ (long_options[option_index].name, "short-options"))
+ display_short_options (options);
+ else if (STREQ (long_options[option_index].name, "qemu")) {
qemu = optarg;
qemu_use_wrapper = 0;
}
--
2.17.1