aboutsummaryrefslogtreecommitdiffstats
path: root/common/argparse.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Change license of argparse.c back to LGPLv2.1Werner Koch2018-03-211-22/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | * common/argparse.c, common/argparse.h: Change license -- On 2011-09-30 the license of these two files were changed from LGPLv2.1 to LGPLv3+/GPLv2+. This was part of a general change from files with either GPLv3+ or LGPv2.1+ to this combination so to allow the use of these files with GPLv2only code. Since then the code was only modified by employees of g10 Code GmbH under my direction and myself. The following changes commit 7249ab0f95d1f6cb8ee61eefedc79801bb56398f Author: Daniel Kahn Gillmor <[email protected]> AuthorDate: Tue Jan 10 15:59:36 2017 -0500 commit eed16ccebf8fd1fdf9709affbd5c831f6957b8ae Author: Daniel Kahn Gillmor <[email protected]> AuthorDate: Fri Nov 21 17:04:42 2014 -0500 and a few typo fixes are minor and thus not copyright-able. Signed-off-by: Werner Koch <[email protected]>
* common: Allow abbreviations of standard options.Marcus Brinkmann2017-07-181-1/+13
| | | | | | | | | | | | | * argparse.h (ARGPARSE_SHORTOPT_HELP, ARGPARSE_SHORTOPT_VERSION, ARGPARSE_SHORTOPT_WARRANTY, ARGPARSE_SHORTOPT_DUMP_OPTIONS): New macros. (ARGPARSE_end): Add some placeholders for standard options. * argparse.c (arg_parse): Fill in missing standard options so default machinery works. Check for standard options in new way. Do not write out standard options for --dump-options. Signed-off-by: Marcus Brinkmann <[email protected]> GnuPG-bug-id: 1747
* Clarify text of LGPLv2+/GPLv2+ licensed files.Werner Koch2017-02-241-2/+2
| | | | --
* Change all http://www.gnu.org in license notices to https://Werner Koch2016-11-051-1/+1
| | | | --
* common: Remove JNLIB from boiler plate (jnlib merge).Werner Koch2015-04-241-6/+6
| | | | | | | * common/README.jnlib: Remove. -- This is the final part of merging jnlib into gnupg/common.
* common: Allow standalone build of argparse.cWerner Koch2015-03-171-6/+5
| | | | | | | * common/argparse.h: Remove types.h - not required. * common/argparse.c: Change to allow standalone use. Signed-off-by: Werner Koch <[email protected]>
* common: Check option arguments for a valid range.Werner Koch2014-10-291-0/+1
| | | | | | | | | * 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]>
* Allow marking options as ignored.Werner Koch2014-03-071-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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: Add meta option ignore-invalid-option.Werner Koch2012-12-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Print warning for arguments not considered an option.Werner Koch2012-03-271-0/+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).
* Nuked almost all trailing white space.post-nuke-of-trailing-wsWerner Koch2011-02-041-4/+4
| | | | | | | | We better do this once and for all instead of cluttering all future commits with diffs of trailing white spaces. In the majority of cases blank or single lines are affected and thus this change won't disturb a git blame too much. For future commits the pre-commit scripts checks that this won't happen again.
* Print --version etc via estreamWerner Koch2010-05-301-0/+1
|
* Merged jnlib into common.Werner Koch2010-03-101-0/+183