1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

* 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.
This commit is contained in:
David Shaw 2004-10-28 03:57:30 +00:00
parent f5b7a72a48
commit f15e944b98
8 changed files with 27 additions and 19 deletions

View File

@ -1,5 +1,9 @@
2004-10-27 David Shaw <dshaw@jabberwocky.com>
* 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.

View File

@ -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;
}

View File

@ -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 {

View File

@ -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);

View File

@ -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;
}

View File

@ -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 {

View File

@ -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 );
}

View File

@ -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 );