Fix use of `--output` when importing to cert-store is the default

  • As clap can not use Default as advertised for certain types [1], use Option<FileOrStdout> instead in cases where the default is to import to cert-store. Semantically, this works as before: By default import to cert-store, when providing "-" output to stdout and when providing a file name output to the file.
  • Since FileOrCertStore can not wrap any other type under the given circumstances, turn it into an empty struct that only implements ClapData to provide static strings for the clap setup.
  • Adapt the help message for FileOrCertStore to mention, that providing "-" leads to output to stdout.

[1] https://github.com/clap-rs/clap/issues/4558

Fixes #133 (closed)

cc @hkos @nwalfield @teythoon @wiktor

Edited by David Runge

Merge request reports

Loading