summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2020-12-18 16:49:06 +0100
committerWerner Koch <wk@gnupg.org>2020-12-18 16:51:00 +0100
commit4b09c8c2023d52b97be6069c20897ebfb25f9bca (patch)
tree4a3e51772ce330b09aff9b72e433babd3d4c3be1 /tests
parent9ee011259f819a3cf50fe7019fa4366dbc437e0e (diff)
downloadlibgpg-error-4b09c8c2023d52b97be6069c20897ebfb25f9bca.tar.gz
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 <wk@gnupg.org>
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]