Home GnuPG

core: Prepare argparse.c to track additional info for options.

Description

core: Prepare argparse.c to track additional info for options.

* src/argparse.c (opttable_t): New.
(struct _gpgrt_argparse_internal_s): Use this instead of a ppointer to
gpgrt_opt_t.
(initialize): Copy options to the new tableand keep an original ordinal.
(_gpgrt_argparse): Adjust for changes.
(any_opt_conffile): Ditto.
(find_long_option): Ditto.
(arg_parse): Ditto.
(long_opt_strlen): Adjust args.
(cmp_ordtbl): New.
(show_help): Print using the ordinal numbers.

We will need to keep extra information along with the options. This
changes prepares this by using a copy of the user provided option
table. The only new info is the original ordinal number which will
allow us to eventually do a binary search on the options but still be
able to print the help in the user defined way.

  • GnuPG-bug-id: T4788
  • Signed-off-by: Werner Koch <wk@gnupg.org>

Details

Provenance
wernerAuthored on Feb 26 2020, 12:07 PM
Parents
rE6fc2d7cb8ce9: core: Add parser for meta commands to gpgrt_argparser.
Branches
Unknown
Tags
Unknown
Tasks
T4788: System wide configuration of the GnuPG system