$ gpg-connect-agent --no-autostart -- NOP /bye
gpg-connect-agent: no gpg-agent running in this session
$ echo $?
0
$
The exit status should indicate an error if the connection fails, as it
did before GnuPG 2.1. (My shell startup script runs gpg-agent for its
ssh support, when not already running, and this change breaks it.)
A workaround is to avoid --no-autostart, and pass a bad --agent-program:
$ gpg-connect-agent --agent-program /dev/null -- NOP /bye
gpg-connect-agent: no running gpg-agent - starting '/dev/null'
gpg-connect-agent: failed to start agent '/dev/null': Permission denied
gpg-connect-agent: can't connect to the agent: Permission denied
gpg-connect-agent: error sending standard options: No agent running
$ echo $?
1
$
- Michael