From b4bd124be496170937d19742d83c2bad7471fe81 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Fri, 7 Jan 2022 17:01:10 -0500 Subject: QPDFArgParser: support adding/printing help information --- .../qtest/arg_parser/completion-top-arg-zsh.out | 2 ++ libtests/qtest/arg_parser/completion-top-arg.out | 2 ++ libtests/qtest/arg_parser/exceptions.out | 7 +++++ libtests/qtest/arg_parser/help-all.out | 32 ++++++++++++++++++++++ libtests/qtest/arg_parser/help-bad.out | 1 + libtests/qtest/arg_parser/help-ewe.out | 3 ++ libtests/qtest/arg_parser/help-quack.out | 3 ++ libtests/qtest/arg_parser/help.out | 9 ++++++ 8 files changed, 59 insertions(+) create mode 100644 libtests/qtest/arg_parser/help-all.out create mode 100644 libtests/qtest/arg_parser/help-bad.out create mode 100644 libtests/qtest/arg_parser/help-ewe.out create mode 100644 libtests/qtest/arg_parser/help-quack.out create mode 100644 libtests/qtest/arg_parser/help.out (limited to 'libtests/qtest/arg_parser') 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. -- cgit v1.2.3-70-g09d2