From f15e944b9872468a574ca8f9cb5849a69e6cdb21 Mon Sep 17 00:00:00 2001 From: David Shaw Date: Thu, 28 Oct 2004 03:57:30 +0000 Subject: [PATCH] * card-util.c, delkey.c, keygen.c, plaintext.c, keyedit.c, passphrase.c, revoke.c: Collapse the two different "can't do that in batch mode" strings into one. --- g10/ChangeLog | 4 ++++ g10/card-util.c | 4 ++-- g10/delkey.c | 4 ++-- g10/keyedit.c | 7 ++++--- g10/keygen.c | 2 +- g10/passphrase.c | 4 ++-- g10/plaintext.c | 7 ++++--- g10/revoke.c | 14 ++++++++------ 8 files changed, 27 insertions(+), 19 deletions(-) diff --git a/g10/ChangeLog b/g10/ChangeLog index 15b3ef7aa..8c5c474dd 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,5 +1,9 @@ 2004-10-27 David Shaw + * card-util.c, delkey.c, keygen.c, plaintext.c, keyedit.c, + passphrase.c, revoke.c: Collapse the two different "can't do that + in batch mode" strings into one. + * keylist.c (status_one_subpacket): New. Send the subpacket data to the --status interface. diff --git a/g10/card-util.c b/g10/card-util.c index 64341280e..066db0c3a 100644 --- a/g10/card-util.c +++ b/g10/card-util.c @@ -67,7 +67,7 @@ change_pin (int chvno, int allow_admin) if (opt.batch) { - log_error (_("sorry, can't do this in batch mode\n")); + log_error (_("can't do this in batch mode\n")); return; } @@ -1195,7 +1195,7 @@ card_edit (STRLIST commands) ; else if (opt.batch && !have_commands) { - log_error(_("can't do that in batchmode\n")); + log_error(_("can't do this in batch mode\n")); goto leave; } diff --git a/g10/delkey.c b/g10/delkey.c index efb9a50d4..eed4d3340 100644 --- a/g10/delkey.c +++ b/g10/delkey.c @@ -117,14 +117,14 @@ do_delete_key( const char *username, int secret, int *r_sec_avail ) okay++; else if( opt.batch && secret ) { - log_error(_("can't do that in batchmode\n")); + log_error(_("can't do this in batch mode\n")); log_info (_("(unless you specify the key by fingerprint)\n")); } else if( opt.batch && opt.answer_yes ) okay++; else if( opt.batch ) { - log_error(_("can't do that in batchmode without \"--yes\"\n")); + log_error(_("can't do this in batch mode without \"--yes\"\n")); log_info (_("(unless you specify the key by fingerprint)\n")); } else { diff --git a/g10/keyedit.c b/g10/keyedit.c index 0211a8bc8..637b84015 100644 --- a/g10/keyedit.c +++ b/g10/keyedit.c @@ -1309,10 +1309,11 @@ keyedit_menu( const char *username, STRLIST locusr, if ( opt.command_fd != -1 ) ; - else if( opt.batch && !have_commands ) { - log_error(_("can't do that in batchmode\n")); + else if( opt.batch && !have_commands ) + { + log_error(_("can't do this in batch mode\n")); goto leave; - } + } /* get the public key */ rc = get_pubkey_byname (NULL, username, &keyblock, &kdbhd, 1); diff --git a/g10/keygen.c b/g10/keygen.c index e03fb60d3..4a6c6ccca 100644 --- a/g10/keygen.c +++ b/g10/keygen.c @@ -2417,7 +2417,7 @@ generate_keypair (const char *fname, const char *card_serialno, if (opt.batch && card_serialno) { /* We don't yet support unattended key generation. */ - log_error (_("sorry, can't do this in batch mode\n")); + log_error (_("can't do this in batch mode\n")); return; } diff --git a/g10/passphrase.c b/g10/passphrase.c index f87017f10..3f6c7d3b9 100644 --- a/g10/passphrase.c +++ b/g10/passphrase.c @@ -1050,7 +1050,7 @@ ask_passphrase (const char *description, } else if (opt.batch) { - log_error(_("can't query password in batchmode\n")); + log_error(_("can't query password in batch mode\n")); pw = NULL; } else { @@ -1208,7 +1208,7 @@ passphrase_to_dek( u32 *keyid, int pubkey_algo, strcpy( pw, fd_passwd ); } else if( opt.batch ) { - log_error(_("can't query password in batchmode\n")); + log_error(_("can't query password in batch mode\n")); pw = m_strdup( "" ); /* return an empty passphrase */ } else { diff --git a/g10/plaintext.c b/g10/plaintext.c index 2e3c49907..a09e5e9e4 100644 --- a/g10/plaintext.c +++ b/g10/plaintext.c @@ -463,11 +463,12 @@ ask_for_detached_datafile( MD_HANDLE md, MD_HANDLE md2, tty_printf("No such file, try again or hit enter to quit.\n"); any++; } - else if( !fp ) { - log_error("can't open `%s': %s\n", answer, strerror(errno) ); + else if( !fp ) + { + log_error(_("can't open `%s': %s\n"), answer, strerror(errno)); rc = G10ERR_READ_FILE; goto leave; - } + } } while( !fp ); } diff --git a/g10/revoke.c b/g10/revoke.c index 58e1c518a..591ff7776 100644 --- a/g10/revoke.c +++ b/g10/revoke.c @@ -211,10 +211,11 @@ gen_desig_revoke( const char *uname ) u32 keyid[2]; int i,any=0; - if( opt.batch ) { - log_error(_("sorry, can't do this in batch mode\n")); + if( opt.batch ) + { + log_error(_("can't do this in batch mode\n")); return G10ERR_GENERAL; - } + } memset( &afx, 0, sizeof afx); @@ -411,10 +412,11 @@ gen_revoke( const char *uname ) struct revocation_reason_info *reason = NULL; KEYDB_SEARCH_DESC desc; - if( opt.batch ) { - log_error(_("sorry, can't do this in batch mode\n")); + if( opt.batch ) + { + log_error(_("can't do this in batch mode\n")); return G10ERR_GENERAL; - } + } memset( &afx, 0, sizeof afx); init_packet( &pkt );