aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2020-12-18 15:49:06 +0000
committerWerner Koch <[email protected]>2020-12-18 15:51:00 +0000
commit4b09c8c2023d52b97be6069c20897ebfb25f9bca (patch)
tree4a3e51772ce330b09aff9b72e433babd3d4c3be1 /tests
parentbuild: Use AC_CHECK_TOOL to detect objdump for cross build. (diff)
downloadlibgpg-error-4b09c8c2023d52b97be6069c20897ebfb25f9bca.tar.gz
libgpg-error-4b09c8c2023d52b97be6069c20897ebfb25f9bca.zip
core: Fix the "ignore" meta command of the argparser.
* src/argparse.c (_gpgrt_argparse): Factor some code out to ... (prepare_arg_return): new. (_gpgrt_argparse): No missing arg error in ignore sections. -- Options in an [ignore] section do not anymore lead to an error if an argument is missing. However, if the option is also in a force section the error is thrown. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'tests')
-rw-r--r--tests/etc/t-argparse.conf6
-rw-r--r--tests/t-argparse.conf2
2 files changed, 6 insertions, 2 deletions
diff --git a/tests/etc/t-argparse.conf b/tests/etc/t-argparse.conf
index f2db907..6559266 100644
--- a/tests/etc/t-argparse.conf
+++ b/tests/etc/t-argparse.conf
@@ -57,6 +57,11 @@ not-my-option
[user wk ]
[-info Options applied only for user wk follow]
+[ignore]
+output
+[-ignore]
+
+
# Change the immutable attribute back to mutable.
[-force]
#compliance gnupg
@@ -72,5 +77,4 @@ my-option 42
# The default algorithm for new keys is set to this.
a-long-option
-
[-echo End global config]
diff --git a/tests/t-argparse.conf b/tests/t-argparse.conf
index f50712e..431ee7d 100644
--- a/tests/t-argparse.conf
+++ b/tests/t-argparse.conf
@@ -13,4 +13,4 @@ my-option 4711
not-my-option
verbose
-[-echo end of user config] \ No newline at end of file
+[-echo end of user config]