Page MenuHome GnuPG

Documentation: mention `status-fd` in "Programmatic use of GnuPG"
Open, Needs TriagePublic

Description

At https://www.gnupg.org/documentation/manuals/gnupg/Programmatic-use-of-GnuPG.html#Programmatic-use-of-GnuPG, gpgme is recommended, but IMO it's worth including something like:

If you cannot use gpgme, please make sure to use --status-fd to clearly obtain information from GnuPG rather than parsing stdout which is subject to change and is otherwise intermingled with status output.

I've found that this is common knowledge with some using GnuPG but not everyone is aware of it.

Event Timeline

werner added a subscriber: werner.

man gpg has a WARNING section right below the RETURN Value section. The 3rd paragraph gives hints on how to use gpg with scripts etc:

For scripted or other unattended use of gpg make sure to
use the machine-parseable interface and not the default
interface which is intended for direct use by humans.  The
machine-parseable interface provides a stable and well
docu‐ mented API independent of the locale or future
changes of gpg.  To enable this interface use the options
--with-colons and --status-fd.  For certain operations the
option --command-fd may come handy too.  See this man page
and the file ‘DETAILS’ for the specification of the
interface.  Note that the GnuPG ``info'' pages as well as
the PDF version of the GnuPG manual features a chapter on
unat‐ tended use of GnuPG.  As an alternative the library
GPGME can be used as a high-level abstraction on top of
that interface.