Repository navigation
feat(cli): attribution in --version, help on a bare invocation - #42
Merged
Merged
Conversation
`--version` now names the copyright holder, the licence and the repository, built from Cargo metadata rather than a second copy that can drift from `Cargo.toml`. `-V` stays the bare `mirsam 0.1.0`, so anything parsing it is unaffected. Attribution is something a reader asks for, so no run that produces a report prints a banner ahead of it: a header on stdout is a header in whatever the pipe on the other end is parsing. For the same reason `mirsam` with no arguments prints the help to stderr and exits 2 (`exit::USAGE`), leaving stdout empty.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
--versiongains an attribution block; a baremirsamprints help instead of a terse error.Why
Attribution is something a reader asks for, never something printed ahead of a report a pipe is waiting on. So:
-Vis unchanged — the baremirsam 0.1.0. Anything parsing it keeps working.CARGO_PKG_VERSION,CARGO_PKG_LICENSE,CARGO_PKG_REPOSITORY), not a second copy that drifts fromCargo.toml. The year is the only literal, and it matchesLICENSE.2(exit::USAGE), leaving stdout empty.Verification
make fmt-check,make lintandmake testall clean — no failures across the suite. Output of-V,--versionand the no-argument case checked by hand, including that stdout is empty for the last.