argparser: Implement a command mode.
* src/gpg-error.h.in (ARGPARSE_FLAG_COMMAND): New. * src/argparse.c (struct _gpgrt_argparse_internal_s): Add flags explicit_cmd_mode, cmd_mode, and command_seen. (initialize): Init them. Mark default commands as commands. (handle_meta_command): New. (handle_metacmd): Add "command-mode" and "-command-mode". (find_long_option): Add arg only_commands. (arg_parse): Factor some code out to ... (handle_special_commands): new. (arg_parse): Implement the command-mode. * tests/t-argparse.c (main): Add some testing code.
- GnuPG-bug-id: T6978