aboutsummaryrefslogtreecommitdiffstats
path: root/g10/gpg.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/gpg.c')
-rw-r--r--g10/gpg.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/g10/gpg.c b/g10/gpg.c
index 10d8c2057..0b3e92404 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -3930,9 +3930,18 @@ main (int argc, char **argv)
generate_keypair (ctrl, 0, argc? *argv : NULL, NULL, 0);
}
else {
- if( argc )
- wrong_args("--gen-key");
- generate_keypair (ctrl, 0, NULL, NULL, 0);
+ if (opt.command_fd != -1 && argc)
+ {
+ if( argc > 1 )
+ wrong_args("--gen-key [parameterfile]");
+
+ opt.batch = 1;
+ generate_keypair (ctrl, 0, argc? *argv : NULL, NULL, 0);
+ }
+ else if (argc)
+ wrong_args ("--gen-key");
+ else
+ generate_keypair (ctrl, 0, NULL, NULL, 0);
}
break;