diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/gpg-card.c | 14 | ||||
-rw-r--r-- | tools/gpg-connect-agent.c | 9 |
2 files changed, 22 insertions, 1 deletions
diff --git a/tools/gpg-card.c b/tools/gpg-card.c index 9c83f556c..1ccace478 100644 --- a/tools/gpg-card.c +++ b/tools/gpg-card.c @@ -43,6 +43,7 @@ #include "../common/server-help.h" #include "../common/openpgpdefs.h" #include "../common/tlv.h" +#include "../common/comopt.h" #include "gpg-card.h" @@ -292,6 +293,17 @@ main (int argc, char **argv) if (log_get_errorcount (0)) exit (2); + /* Process common component options. */ + if (parse_comopt (GNUPG_MODULE_NAME_CARD, opt.debug)) + { + gnupg_status_printf (STATUS_FAILURE, "option-parser %u", + gpg_error (GPG_ERR_GENERAL)); + exit(2); + } + + if (comopt.no_autostart) + opt.autostart = 0; + /* Set defaults for non given options. */ if (!opt.gpg_program) opt.gpg_program = gnupg_module_name (GNUPG_MODULE_NAME_GPG); @@ -3505,7 +3517,7 @@ cmd_yubikey (card_info_t info, char *argstr) err = yubikey_commands (info, fp, nwords, words); err2 = scd_learn (info, 0); if (err2) - log_error ("Error re-reading card: %s\n", gpg_strerror (err)); + log_error ("Error re-reading card: %s\n", gpg_strerror (err2)); leave: return err; diff --git a/tools/gpg-connect-agent.c b/tools/gpg-connect-agent.c index 6132ef0eb..8d9e83fa8 100644 --- a/tools/gpg-connect-agent.c +++ b/tools/gpg-connect-agent.c @@ -29,6 +29,7 @@ #include <unistd.h> #include <assert.h> +#define INCLUDED_BY_MAIN_MODULE 1 #include "../common/i18n.h" #include "../common/util.h" #include "../common/asshelp.h" @@ -39,6 +40,7 @@ # include "../common/exechelp.h" #endif #include "../common/init.h" +#include "../common/comopt.h" #define CONTROL_D ('D' - 'A' + 1) @@ -1255,6 +1257,13 @@ main (int argc, char **argv) if (log_get_errorcount (0)) exit (2); + /* Process common component options. */ + if (parse_comopt (GNUPG_MODULE_NAME_CONNECT_AGENT, opt.verbose > 1)) + exit(2); + + if (comopt.no_autostart) + opt.autostart = 0; + /* --uiserver is a shortcut for a specific raw socket. This comes in particular handy on Windows. */ if (opt.use_uiserver) |