aboutsummaryrefslogtreecommitdiffstats
path: root/common/argparse.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Distinguish between ARGPARSE_AMBIGUOUS_{OPTION,COMMAND}Daniel Kahn Gillmor2014-11-241-1/+1
| | | | | | | | | | | * common/argparse.c (initialize): Use correct value. -- This avoids a dead path in the argparse code. It's not clear that this is needed, however, since ARGPARSE_AMBIGUOUS_COMMAND is never actually used in the code. Another approach would be to trim out ARGPARSE_AMBIGUOUS_COMMAND entirely.
* Change a couple of files to use abbreviated copyright notes.Werner Koch2014-11-041-3/+2
| | | | | | | | | -- Also fixed some of my own copyright notices due to the termination of my assignment. The one displayed by --version is kept at FSF because we had contributors in 2014 with FSF assignments and it gives the FSF some visibility.
* common: Check option arguments for a valid range.Werner Koch2014-10-291-8/+45
| | | | | | | | | * common/argparse.h (ARGPARSE_INVALID_ARG): New. * common/argparse.c: Include limits h and errno.h. (initialize): Add error strings for new error constant. (set_opt_arg): Add range checking. Signed-off-by: Werner Koch <[email protected]>
* w32: Fix build problem with dirmngr.Werner Koch2014-06-101-1/+1
| | | | | * dirmngr/ks-engine-hkp.c (EAI_SYSTEM) [W32]: Add replacement constant.
* Make more use of *_NAME macros.Werner Koch2014-05-081-1/+1
| | | | | | | | | * configure.ac (GPG_DISP_NAME, GPGSM_DISP_NAME): New. (GPG_AGENT_DISP_NAME, SCDAEMON_DISP_NAME): New. (DIRMNGR_DISP_NAME, G13_DISP_NAME): New. (GPGCONF_DISP_NAME): New. (SCDAEMON_SOCK_NAME): New. * common/argparse.c (show_help): Map description string.
* Allow marking options as ignored.Werner Koch2014-03-071-13/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * jnlib/argparse.h (ARGPARSE_OPT_IGNORE): New. (ARGPARSE_TYPE_MASK): New, for internal use. (ARGPARSE_ignore): New. * jnlib/argparse.c (optfile_parse, arg_parse): Replace remaining constants by macros. (optfile_parse): Implement ARGPARSE_OPT_IGNORE. (arg_parse): Exclide ignore options from --dump-options. -- In addition to the ignore-invalid-option (commit 41d56433) it is often useful to mark options in a configuration which as NOP. For example options which have no more function at all but can be expected to be found in existing conf files. Such an option (or command) may now be given as ARGPARSE_ignore (300, "obsolete-option") The 300 is merely used as a non-valid single option name much like group names or the 500+n values used for long options. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 54c54e2824aab5716a187bbbf6dff8860d6a6056) Resolved conflicts: common/argparse.c: Fixed.
* common: Replace all macros in strusage() returned strings.Werner Koch2014-02-261-71/+5
| | | | | | * common/argparse.c (writechar): Remove. (writestrings): Simplify. (strusage): Use map_static_macro_string.
* Add strusage macro replacement feature.Werner Koch2013-11-181-32/+71
| | | | | | | | | | | | | * common/argparse.c (writechar): New. (writestrings): Add macro replacement feature. (show_help): Remove specialized @EMAIL@ replacement. * configure.ac (GNUPG_NAME, GPG_NAME, GPGSM_NAME): Define. (GPG_AGENT_NAME, DIRMNGR_NAME, G13_NAME, GPGCONF_NAME): Define. (GPGTAR_NAME, GPG_AGENT_INFO_NAME, GPG_AGENT_SOCK_NAME): Define. (GPG_AGENT_SSH_SOCK_NAME, DIRMNGR_INFO_NAME): Define. (DIRMNGR_SOCK_NAME): Define. Signed-off-by: Werner Koch <[email protected]>
* common: Add meta option ignore-invalid-option.Werner Koch2012-12-181-6/+153
| | | | | | | | | | | | | | | | | | | | | | | | * common/argparse.c (iio_item_def_s, IIO_ITEM_DEF): New. (initialize): Init field IIO_LIST. (ignore_invalid_option_p): New. (ignore_invalid_option_add): New. (ignore_invalid_option_clear): New. (optfile_parse): Implement meta option. -- This option is currently of no use. However, as soon as it has been deployed in all stable versions of GnuPG, it will allow the use of the same configuration file with an old and a new version of GnuPG. For example: If a new version implements the option "foobar", and a user uses it in gpg.conf, an old version of gpg would bail out with the error "invalid option". To avoid that the following line can be put above that option in gpg.conf ignore-invalid-option foobar This meta option may be given several times or several option names may be given as arguments (space delimited). Note that this option is not available on the command line.
* Change all quotes in strings and comments to the new GNU standard.Werner Koch2012-06-051-3/+3
| | | | | | | | | | | | | | | | | | | The asymmetric quotes used by GNU in the past (`...') don't render nicely on modern systems. We now use two \x27 characters ('...'). The proper solution would be to use the correct Unicode symmetric quotes here. However this has the disadvantage that the system requires Unicode support. We don't want that today. If Unicode is available a generated po file can be used to output proper quotes. A simple sed script like the one used for en@quote is sufficient to change them. The changes have been done by applying sed -i "s/\`\([^'\`]*\)'/'\1'/g" to most files and fixing obvious problems by hand. The msgid strings in the po files were fixed with a similar command.
* Print warning for arguments not considered an option.Werner Koch2012-03-271-1/+2
| | | | | | | | | | | | | | | | | | GnuPG requires that options are given before other arguments. This can sometimes be confusing. We now print a warning if we found an argument looking alike a long option without being preceded by the stop option. This is bug#1343. * common/argparse.h (ARGPARSE_FLAG_STOP_SEEN): New. * common/argparse.c (arg_parse): Set new flag. * g10/gpg.c (main): Print the warning. * agent/gpg-agent.c (main): Ditto. * dirmngr/dirmngr.c (main): Ditto. * g13/g13.c (main): Ditto. * scd/scdaemon.c (main): Ditto. * sm/gpgsm.c (main): Ditto. * tools/gpg-connect-agent.c (main): Ditto. * tools/gpgconf.c (main): Ditto.
* Change JNLIB license to LGPLv3+ or GPLv2+.Werner Koch2011-09-301-7/+18
| | | | This is to allow the use of this code with code under GPLv2(only).
* Update copyright yearWerner Koch2011-02-031-62/+62
| | | | Nuked some trailing spaces.
* Some work on the dirmngrWerner Koch2010-07-261-1/+1
|
* Print --version etc via estreamWerner Koch2010-05-301-50/+135
|
* More chnages to use estream. Add a way to replace the standardWerner Koch2010-03-221-0/+2
| | | | | descriptors.
* Merged jnlib into common.Werner Koch2010-03-101-0/+1205