As I copied your line wich states the invalid option argument, I noticed, that in front of the options, there are not two dashes “–”, but one long dash “—”. This may already help.
The “–passphrase-fd n” option reads the passphrase from the file that is located at “n”. So
Is just a work around to not save the passphrase into a file. But note, that you have to escape special chracters.
However, it could be that your version is that old, that --passphrase-fd is not implemented. I got a local installation of “gpgsm (GnuPG) 2.2.0” and i have the option installed.
It seems that you are working with or for a company, if you have further questions and issues, please consider consulting our paid and professional support (https://www.gpg4win.org/support.html). If you are just curious, consider a donation (https://www.gpg4win.org/donate.html) to keep up the work at Gpg4win.
I think it is strange that passphrase-fd is not implemented in this version.
Is there another way to do this?
I think it is very strange that this is so difficult. This is something that everyone is interested to do. I hope that you can tell the answer/advice here because it is not only me that is interested in this.
note that there are a number of different use case how to enter a passphrase
automatically. (And yes, it should get its own wiki page to have an overview of the answers.)
a) unattended machine, rebootable:
→ use a secret key without passphrase
b) unattended machine, manual reboot:
→ use gpg-preset-passphrase with the agent
Variant of a) and b) to protect the secret key material better:
→ use a hardware crypto token (usb stick or smartcard)
(Currently I’m unsure if there are smartcard without pins for a)).
c) Passphrase is coming from a different code part (e.g. interactively)
→ fullfill the pinentry protocol, so your code is a special pinentry
Hope this helps, asking on gnupg-users@ is another options.
Best,
Bernhard