summaryrefslogtreecommitdiffstats
path: root/libtests/qtest/arg_parser
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-01-07 23:01:10 +0100
committerJay Berkenbilt <ejb@ql.org>2022-01-30 19:11:03 +0100
commitb4bd124be496170937d19742d83c2bad7471fe81 (patch)
tree0cd998483de30c688cf5130c90fd4ee94f47833c /libtests/qtest/arg_parser
parent5303130cf920ad9242bd1bb5ad998a791eb7e205 (diff)
downloadqpdf-b4bd124be496170937d19742d83c2bad7471fe81.tar.zst
QPDFArgParser: support adding/printing help information
Diffstat (limited to 'libtests/qtest/arg_parser')
-rw-r--r--libtests/qtest/arg_parser/completion-top-arg-zsh.out2
-rw-r--r--libtests/qtest/arg_parser/completion-top-arg.out2
-rw-r--r--libtests/qtest/arg_parser/exceptions.out7
-rw-r--r--libtests/qtest/arg_parser/help-all.out32
-rw-r--r--libtests/qtest/arg_parser/help-bad.out1
-rw-r--r--libtests/qtest/arg_parser/help-ewe.out3
-rw-r--r--libtests/qtest/arg_parser/help-quack.out3
-rw-r--r--libtests/qtest/arg_parser/help.out9
8 files changed, 59 insertions, 0 deletions
diff --git a/libtests/qtest/arg_parser/completion-top-arg-zsh.out b/libtests/qtest/arg_parser/completion-top-arg-zsh.out
index 5a500d38..5c159957 100644
--- a/libtests/qtest/arg_parser/completion-top-arg-zsh.out
+++ b/libtests/qtest/arg_parser/completion-top-arg-zsh.out
@@ -2,7 +2,9 @@
--completion-zsh
--help
--help=
+--help=--ewe
--help=all
+--help=quack
--moo
--moo=
--oink=
diff --git a/libtests/qtest/arg_parser/completion-top-arg.out b/libtests/qtest/arg_parser/completion-top-arg.out
index 4e69efbd..db3d4b0a 100644
--- a/libtests/qtest/arg_parser/completion-top-arg.out
+++ b/libtests/qtest/arg_parser/completion-top-arg.out
@@ -1,5 +1,7 @@
--baaa
--completion-zsh
+--help
+--help=
--moo
--moo=
--oink=
diff --git a/libtests/qtest/arg_parser/exceptions.out b/libtests/qtest/arg_parser/exceptions.out
index 82eef2a7..eb8dbe8a 100644
--- a/libtests/qtest/arg_parser/exceptions.out
+++ b/libtests/qtest/arg_parser/exceptions.out
@@ -4,3 +4,10 @@ duplicate table: QPDFArgParser: registering already registered option table baaa
unknown table: QPDFArgParser: selecting unregistered option table aardvark
copy from unknown table: QPDFArgParser: attempt to copy from unknown table two
copy unknown from other table: QPDFArgParser: attempt to copy unknown argument two from table baaa
+add existing help topic: QPDFArgParser: topic baaa has already been added
+add reserved help topic: QPDFArgParser: can't register reserved help topic all
+add to unknown topic: QPDFArgParser: unable to add option --new to unknown help topic oops
+bad option for help: QPDFArgParser: options for help must start with --
+bad topic for help: QPDFArgParser: help topics must not start with -
+duplicate option help: QPDFArgParser: option --ewe already has help
+invalid choice handler to unknown: QPDFArgParser: attempt to add invalid choice handler to unknown argument
diff --git a/libtests/qtest/arg_parser/help-all.out b/libtests/qtest/arg_parser/help-all.out
new file mode 100644
index 00000000..432d4afb
--- /dev/null
+++ b/libtests/qtest/arg_parser/help-all.out
@@ -0,0 +1,32 @@
+Run "arg_parser --help=topic" for help on a topic.
+Run "arg_parser --help=option" for help on an option.
+Run "arg_parser --help=all" to see all available help.
+
+Topics:
+ baaa: Baaa Options
+ quack: Quack Options
+
+== topic baaa (Baaa Options) ==
+
+Ewe can do sheepish things.
+For example, ewe can add more ram to your computer.
+
+Related options:
+ --ewe: just for ewe
+ --ram: curly horns
+
+== topic quack (Quack Options) ==
+
+Just put stuff after quack to get a count at the end.
+
+== option --ewe (just for ewe) ==
+
+You are not a ewe.
+
+== option --ram (curly horns) ==
+
+curly horns
+
+====
+
+For more help, read the manual.
diff --git a/libtests/qtest/arg_parser/help-bad.out b/libtests/qtest/arg_parser/help-bad.out
new file mode 100644
index 00000000..e9d753b2
--- /dev/null
+++ b/libtests/qtest/arg_parser/help-bad.out
@@ -0,0 +1 @@
+usage: unknown help option --oops
diff --git a/libtests/qtest/arg_parser/help-ewe.out b/libtests/qtest/arg_parser/help-ewe.out
new file mode 100644
index 00000000..7fe4bb0e
--- /dev/null
+++ b/libtests/qtest/arg_parser/help-ewe.out
@@ -0,0 +1,3 @@
+You are not a ewe.
+
+For more help, read the manual.
diff --git a/libtests/qtest/arg_parser/help-quack.out b/libtests/qtest/arg_parser/help-quack.out
new file mode 100644
index 00000000..b114471e
--- /dev/null
+++ b/libtests/qtest/arg_parser/help-quack.out
@@ -0,0 +1,3 @@
+Just put stuff after quack to get a count at the end.
+
+For more help, read the manual.
diff --git a/libtests/qtest/arg_parser/help.out b/libtests/qtest/arg_parser/help.out
new file mode 100644
index 00000000..0accbe67
--- /dev/null
+++ b/libtests/qtest/arg_parser/help.out
@@ -0,0 +1,9 @@
+Run "arg_parser --help=topic" for help on a topic.
+Run "arg_parser --help=option" for help on an option.
+Run "arg_parser --help=all" to see all available help.
+
+Topics:
+ baaa: Baaa Options
+ quack: Quack Options
+
+For more help, read the manual.