Home GnuPG

core: Allow returning of attributes from gpgrt_argparser.

Description

core: Allow returning of attributes from gpgrt_argparser.

* src/gpg-error.h.in (ARGPARSE_FLAG_WITHATTR): New.
(ARGPARSE_ATTR_FORCE): New.
(ARGPARSE_ATTR_IGNORE): New.
(ARGPARSE_TYPE_MASK): Moved from argparse.c to here.
* src/argparse.c: Always use macros for constants.
(_gpgrt_argparse): Handle ARGPARSE_FLAG_WITHATTR.
(arg_parse): Ditto.
* tests/t-argparse.c (main): Add commented test case.

This is a ABI compatible hack to allow the ignore and force attributes
as well as to return which option has been ignored in a user file or
on the command line.

  • Signed-off-by: Werner Koch <wk@gnupg.org>

Details

Provenance
wernerAuthored on Mar 2 2020, 4:53 PM
Parents
rE2d1969ab465b: core: Implement meta commands for the argparser.
Branches
Unknown
Tags
Unknown