on STABLE-BRANCH-2-2, generate_keypair() in g10/keygen.c says:
/* We don't yet support unattended key generation. */ log_error (_("can't do this in batch mode\n"));
but clearly gnupg does support unattended key generation, thanks to the --quick-* options.
Also, this error message is pretty vague -- what's "this" supposed to mean? it would be good to clean up both the comments (so that the code is more understandable), and the error message (so that the tool reports the failure more specifically to the user at runtime)