aboutsummaryrefslogtreecommitdiffstats
path: root/common/argparse.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Release 2.2.13gnupg-2.2.13Werner Koch2019-02-121-1/+1
|
* Release 2.2.5gnupg-2.2.5Werner Koch2018-02-221-1/+1
| | | | Signed-off-by: Werner Koch <[email protected]>
* indent: Wrap overlong lines in argparse.cWerner Koch2017-08-011-5/+10
| | | | --
* common: Allow abbreviations of standard options.Marcus Brinkmann2017-07-181-6/+39
| | | | | | | | | | | | | * 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
| | | | --
* Clean up word replication.Yuri Chornoivan2017-02-211-2/+2
| | | | | | | | | -- This fixes extra word repetitions (like "the the" or "is is") in the code and docs. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* Update copyright notices for 2017.Werner Koch2017-01-231-2/+2
| | | | | | | | -- Also some http:// -> https:// fixes. Signed-off-by: Werner Koch <[email protected]>
* common: Avoid unnecessary ambiguity in argparse.Daniel Kahn Gillmor2017-01-111-1/+3
| | | | | | | | | | | | | * common/argparse.c (find_long_option): Avoid unnecessary ambiguity. -- If two struct ARGPARSE_OPTS share a prefix in their long_opt name, but have the exact same short_opt and flags, they are aliases and not distinct options. Avoid reporting this as an ambiguity, so that (for example) both --clearsign and --clear-sign can be invoked as --clear. Signed-off-by: Daniel Kahn Gillmor <[email protected]> Debian-Bug-Id: 850475
* common: Skip the Byte Order Mark in conf files.Werner Koch2016-12-081-1/+19
| | | | | | * common/argparse.c (optfile_parse): Detect and skip the UTF-8 BOM. Signed-off-by: Werner Koch <[email protected]>
* common: Annotate semi-static allocation.Justus Winter2016-07-011-0/+2
| | | | | | * common/argparse.c (optfile_parse): Allow string arguments to leak. Signed-off-by: Justus Winter <[email protected]>
* common: Print https URLs in help messages.Werner Koch2016-05-031-4/+4
| | | | | | * common/argparse.c (strusage): Print https URLS. Signed-off-by: Werner Koch <[email protected]>
* Update copyright years.Werner Koch2016-01-261-2/+2
| | | | --
* Fix typos found using codespell.Justus Winter2015-11-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * agent/cache.c: Fix typos. * agent/call-pinentry.c: Likewise. * agent/call-scd.c: Likewise. * agent/command-ssh.c: Likewise. * agent/command.c: Likewise. * agent/divert-scd.c: Likewise. * agent/findkey.c: Likewise. * agent/gpg-agent.c: Likewise. * agent/w32main.c: Likewise. * common/argparse.c: Likewise. * common/audit.c: Likewise. * common/audit.h: Likewise. * common/convert.c: Likewise. * common/dotlock.c: Likewise. * common/exechelp-posix.c: Likewise. * common/exechelp-w32.c: Likewise. * common/exechelp-w32ce.c: Likewise. * common/exechelp.h: Likewise. * common/helpfile.c: Likewise. * common/i18n.h: Likewise. * common/iobuf.c: Likewise. * common/iobuf.h: Likewise. * common/localename.c: Likewise. * common/logging.c: Likewise. * common/openpgp-oid.c: Likewise. * common/session-env.c: Likewise. * common/sexputil.c: Likewise. * common/sysutils.c: Likewise. * common/t-sexputil.c: Likewise. * common/ttyio.c: Likewise. * common/util.h: Likewise. * dirmngr/cdblib.c: Likewise. * dirmngr/certcache.c: Likewise. * dirmngr/crlcache.c: Likewise. * dirmngr/dirmngr-client.c: Likewise. * dirmngr/dirmngr.c: Likewise. * dirmngr/dirmngr_ldap.c: Likewise. * dirmngr/dns-stuff.c: Likewise. * dirmngr/http.c: Likewise. * dirmngr/ks-engine-hkp.c: Likewise. * dirmngr/ks-engine-ldap.c: Likewise. * dirmngr/ldap-wrapper.c: Likewise. * dirmngr/ldap.c: Likewise. * dirmngr/misc.c: Likewise. * dirmngr/ocsp.c: Likewise. * dirmngr/validate.c: Likewise. * g10/encrypt.c: Likewise. * g10/getkey.c: Likewise. * g10/gpg.c: Likewise. * g10/gpgv.c: Likewise. * g10/import.c: Likewise. * g10/keydb.c: Likewise. * g10/keydb.h: Likewise. * g10/keygen.c: Likewise. * g10/keyid.c: Likewise. * g10/keylist.c: Likewise. * g10/keyring.c: Likewise. * g10/mainproc.c: Likewise. * g10/misc.c: Likewise. * g10/options.h: Likewise. * g10/packet.h: Likewise. * g10/parse-packet.c: Likewise. * g10/pkclist.c: Likewise. * g10/pkglue.c: Likewise. * g10/plaintext.c: Likewise. * g10/server.c: Likewise. * g10/sig-check.c: Likewise. * g10/sqlite.c: Likewise. * g10/tdbio.c: Likewise. * g10/test-stubs.c: Likewise. * g10/tofu.c: Likewise. * g10/trust.c: Likewise. * g10/trustdb.c: Likewise. * g13/create.c: Likewise. * g13/mountinfo.c: Likewise. * kbx/keybox-blob.c: Likewise. * kbx/keybox-file.c: Likewise. * kbx/keybox-init.c: Likewise. * kbx/keybox-search-desc.h: Likewise. * kbx/keybox-search.c: Likewise. * kbx/keybox-update.c: Likewise. * scd/apdu.c: Likewise. * scd/app-openpgp.c: Likewise. * scd/app-p15.c: Likewise. * scd/app.c: Likewise. * scd/ccid-driver.c: Likewise. * scd/command.c: Likewise. * scd/iso7816.c: Likewise. * sm/base64.c: Likewise. * sm/call-agent.c: Likewise. * sm/call-dirmngr.c: Likewise. * sm/certchain.c: Likewise. * sm/gpgsm.c: Likewise. * sm/import.c: Likewise. * sm/keydb.c: Likewise. * sm/minip12.c: Likewise. * sm/qualified.c: Likewise. * sm/server.c: Likewise. * tools/gpg-check-pattern.c: Likewise. * tools/gpgconf-comp.c: Likewise. * tools/gpgkey2ssh.c: Likewise. * tools/gpgparsemail.c: Likewise. * tools/gpgtar.c: Likewise. * tools/rfc822parse.c: Likewise. * tools/symcryptrun.c: Likewise. Signed-off-by: Justus Winter <[email protected]>
* common: Fix regression in building argpase.c standalone.Werner Koch2015-09-011-0/+7
| | | | * common/argparse.c (is_native_utf8) [GNUPG_MAJOR_VERSION]: New.
* common: Remove JNLIB from boiler plate (jnlib merge).Werner Koch2015-04-241-3/+3
| | | | | | | * common/README.jnlib: Remove. -- This is the final part of merging jnlib into gnupg/common.
* common: Remove libjnlib-config.h (jnlib merge).Werner Koch2015-04-241-35/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/libjnlib-config.h: Remove. * common/common-defs.h (getenv) [HAVE_GETENV]: New. From removed header. (getpid) [HAVE_W32CE_SYSTEM]: New. From removed header. * common/argparse.c: Include util.h and common-defs.h. Replace jnlib_ macro names for non-GNUPG builds by x* names. * common/dotlock.c: Ditto. * common/logging.c: Include util.h and common-defs.h. Replace jnlib_ symbol names by x* names. * common/strlist.c: Ditto. * common/utf8conv.c: Ditto. * common/w32-reg.c: Ditto. * common/mischelp.c: Ditto. Also remove _jnlib_free. * common/stringhelp.c: Ditto. (JNLIB_LOG_WITH_PREFIX): Do not depend on this macro. * common/logging.h (JNLIB_LOG_WITH_PREFIX): Do not depend on this macro. -- This is part 1 of the patches to merge the jnlib files into common/. It does not make much sense to keep jnlib/ files separate. They are not often use elsewhere and maintaining the complex marcos stuff is too troublesome for the future. Signed-off-by: Werner Koch <[email protected]>
* common: Add feature to ease using argparse's usage().Werner Koch2015-03-171-0/+20
| | | | | | | | | | | * common/argparse.c (show_help): Take care of flag value (usage): Ditto. -- It is common that the long usage note starts with the short usage note. The new flag feature allows to combine both. Signed-off-by: Werner Koch <[email protected]>
* common: Allow standalone build of argparse.cWerner Koch2015-03-171-49/+164
| | | | | | | * common/argparse.h: Remove types.h - not required. * common/argparse.c: Change to allow standalone use. Signed-off-by: Werner Koch <[email protected]>
* Update copyright years.Werner Koch2015-02-031-1/+1
| | | | | * common/w32info-rc.h.in (W32INFO_COMPANYNAME): Change to "The GnuPG Project".
* 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