aboutsummaryrefslogtreecommitdiffstats
path: root/common/argparse.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2015-03-17common: Add feature to ease using argparse's usage().Werner Koch1-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]>
2015-03-17common: Allow standalone build of argparse.cWerner Koch1-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]>
2015-02-03Update copyright years.Werner Koch1-1/+1
* common/w32info-rc.h.in (W32INFO_COMPANYNAME): Change to "The GnuPG Project".
2014-11-24Distinguish between ARGPARSE_AMBIGUOUS_{OPTION,COMMAND}Daniel Kahn Gillmor1-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.
2014-11-04Change a couple of files to use abbreviated copyright notes.Werner Koch1-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.
2014-10-29common: Check option arguments for a valid range.Werner Koch1-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]>
2014-06-10w32: Fix build problem with dirmngr.Werner Koch1-1/+1
* dirmngr/ks-engine-hkp.c (EAI_SYSTEM) [W32]: Add replacement constant.
2014-05-08Make more use of *_NAME macros.Werner Koch1-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.
2014-03-07Allow marking options as ignored.Werner Koch1-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.
2014-02-26common: Replace all macros in strusage() returned strings.Werner Koch1-71/+5
* common/argparse.c (writechar): Remove. (writestrings): Simplify. (strusage): Use map_static_macro_string.
2013-11-18Add strusage macro replacement feature.Werner Koch1-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]>
2012-12-18common: Add meta option ignore-invalid-option.Werner Koch1-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.
2012-06-05Change all quotes in strings and comments to the new GNU standard.Werner Koch1-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.
2012-03-27Print warning for arguments not considered an option.Werner Koch1-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.
2011-09-30Change JNLIB license to LGPLv3+ or GPLv2+.Werner Koch1-7/+18
This is to allow the use of this code with code under GPLv2(only).
2011-02-03Update copyright yearWerner Koch1-62/+62
Nuked some trailing spaces.
2010-07-26Some work on the dirmngrWerner Koch1-1/+1
2010-05-30Print --version etc via estreamWerner Koch1-50/+135
2010-03-22More chnages to use estream. Add a way to replace the standardWerner Koch1-0/+2
descriptors.
2010-03-10Merged jnlib into common.Werner Koch1-0/+0
2010-01-08Add dummu option --passwd for gpg.Werner Koch1-1/+1
Collected changes.
2009-03-03Argg again: Remove cruft from a test.Werner Koch1-1/+1
2009-03-03Add --reload command to gpgconf.Werner Koch1-1/+1
Fix a problem in exechelp.c Get ready for a release.
2009-01-08Update spanish translation.Werner Koch1-1/+1
Cleanups. Allow utf-8 in email addresses.
2008-11-20Fix last change.Werner Koch1-3/+3
2008-11-12Made arg_parse more readable.Werner Koch1-304/+385
2008-10-20Marked all unused args on non-W32 platforms.Werner Koch1-0/+5
2008-09-29Remove hacks which are not anymore needed since we now require Libgcrypt 1.4Werner Koch1-181/+252
2008-05-27Fixed segv in gpg-agent (command marktrusted).Werner Koch1-1/+6
Replaced almost all free by xfree. Translation fixes.
2008-02-22Add some tests.Werner Koch1-2/+2
2007-08-29Extended the --check-program output: Error messages are now inlcued in anWerner Koch1-53/+59
easy parsable format.
2007-08-10Implemented the chain model for X.509 validation.Werner Koch1-1/+14
2007-07-04Changed to GPLv3.Werner Koch1-7/+5
Removed intl/.
2007-07-04A bunch of minor changes for Windows.Werner Koch1-49/+57
2007-05-04UTF-8 FixesWerner Koch1-16/+33
2007-03-07The Cherry XX44 keyboard's PINpad does now work.Werner Koch1-1/+1
DINSIG and NKS card applications are now also PIN pad aware.
2006-10-02Fix for bug 537Werner Koch1-14/+14
2006-06-20Updated FSF's address.Werner Koch1-14/+16
2005-06-16gcc-4 defaults forced me to edit many many files to get rid of theWerner Koch1-1/+1
char * vs. unsigned char * warnings. The GNU coding standards used to say that these mismatches are okay and better than a bunch of casts. Obviously this has changed now.
2005-02-22(stream_read_string): Removed call to abort onWerner Koch1-1/+1
memory error because the CVS version of libgcrypt makes sure that ERRNO gets always set on error even with a faulty user supplied function.
2004-01-16* argparse.c (strusage): Changed default copyright year to 2004.Werner Koch1-1/+1
2003-12-17(initialize): Replaced use of non-literal formaWerner Koch1-15/+17
args. Suggested by Florian Weimer.
2003-01-09Updated from NewPGWerner Koch1-0/+997
2002-06-29Removed files for CVS reorganizationDavid Shaw1-994/+0
2000-07-14See ChangeLog: Fri Jul 14 19:38:23 CEST 2000 Werner KochWerner Koch1-2/+2
2000-01-24Add files to new directory.Werner Koch1-0/+994
This is mainly stuff moved from ../util to here.