serpent-os / moss

The safe, fast and sane package manager for Linux
https://serpentos.com
71 stars 9 forks source link

moss + boulder: Streamline version info commands/options/flags #233

Open ermo opened 1 month ago

ermo commented 1 month ago

Proposal

Enable version, -V and --version as the supported arguments, so we increase the likelihood for people to get a match if they're looking for version info.

Additionally, make moss and boulder print out version information as # <executable> version (git hash) if an invocation contains commands in addition to -V/--version, such as boulder --version build or moss --version install (...).

This will enable infrastructure tooling to always call moss and boulder with the --version argument, which is a benefit when checking logs for which versions were used build/install packages, which in turn means that operationally, canary builds will also serve as a way to ensure that the deployed versions are the ones that we expected to be deployed.

Context

Currently, moss and boulder don't support the same arguments when trying to get version info:

$ moss -V
error: unexpected argument '-V' found

Usage: moss [OPTIONS] [COMMAND]

For more information, try '--help'.
$ moss -v
moss 0.1.0 (931a4f5)
$ moss --version
moss 0.1.0 (931a4f5)
$ moss version
moss 0.1.0 (931a4f5)

$ boulder -V
boulder 0.1.0 (931a4f5)
$ boulder -v
error: unrecognized subcommand 'version'

Usage: boulder [OPTIONS] <COMMAND>

For more information, try '--help'.
$ boulder --version
boulder 0.1.0 (931a4f5)
$ boulder version
error: unrecognized subcommand 'version'

Usage: boulder [OPTIONS] <COMMAND>

For more information, try '--help'.