Home GnuPG

core: Add parser for meta commands to gpgrt_argparser.

Description

core: Add parser for meta commands to gpgrt_argparser.

* src/gpg-error.h.in (ARGPARSE_INVALID_META): New
(ARGPARSE_UNKNOWN_META, ARGPARSE_UNEXPECTED_META): New.
* src/argparse.c (struct _gpgrt_argparse_internal_s): Add flag
insysconfig.
(initialize): Init flag.  Add error strings.
(_gpgrt_argparser): Set that flag.
(_gpgrt_argparse): Add parsing of meta commands.
* tests/etc/t-argparse.conf: Add some test cases.
* tests/t-argparse.conf: Ditto.
* tests/t-argparse.c (main): Die only after printing all warnings.

Noe that this is just the framework to add meta commands to the global
config file. We also need to get away from fixes test config files
and create them on the fly to that we are able to test also errors.

Details

Provenance
wernerAuthored on Feb 25 2020, 9:03 PM
Parents
rEca79d5edee8c: core: Fold duplicated code from _gpgrt_argparse.
Branches
Unknown
Tags
Unknown
Tasks
T4788: System wide configuration of the GnuPG system