aead / minisign

A dead simple tool to sign files and verify digital signatures.
https://jedisct1.github.io/minisign/
MIT License
117 stars 15 forks source link

Use stdout only for literal text of trusted content #21

Open charles-dyfis-net opened 1 year ago

charles-dyfis-net commented 1 year ago

Per POSIX conventions, stdout is for "conventional output", whereas stderr is for "diagnostic output". Diagnostic output is conventionally interpreted to include logs, status messages, prompts, or other content of interest to human operators, such that stdout can be directed through pipelines or redirections for programmatic consumption while stderr is routed directly to the human operator.

-Q is modified from "pretty quiet" to instead be a directive to write the literal text of the trusted comment to stdout; this provides a programmatic way to retrieve that comment that doesn't require filtering/modifying output to separate the literal text from the explanatory prose.

charles-dyfis-net commented 1 year ago

I think there's a bug in here -- getting an extra CRLF on stderr and signatures generated on stdout without a trailing newline. Withdrawing to draft for now.

charles-dyfis-net commented 1 year ago

On further investigation, that trailing-newline delta is present on main without this PR merged; it's thus not a new bug. Reopening.