From 4b09c8c2023d52b97be6069c20897ebfb25f9bca Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 18 Dec 2020 16:49:06 +0100 Subject: 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 --- tests/etc/t-argparse.conf | 6 +++++- tests/t-argparse.conf | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'tests') 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] -- cgit v1.2.3