Skip to content

feat(cli): attribution in --version, help on a bare invocation - #42

Merged
aenawi merged 1 commit into
mainfrom
cli-version-attribution
Sep 5, 2026
Merged

aenawi merged 1 commit into
mainfrom
cli-version-attribution

Conversation

@aenawi

@aenawi aenawi commented Sep 5, 2026

Copy link
Copy Markdown
Owner

What

--version gains an attribution block; a bare mirsam prints help instead of a terse error.

$ mirsam -V
mirsam 0.1.0

$ mirsam --version
mirsam 0.1.0
Copyright (C) 2026 Hashem Aldhaheri and contributors
License: MIT — see LICENSE and CREDITS.md
https://github.com/aenawi/mirsam

Why

Attribution is something a reader asks for, never something printed ahead of a report a pipe is waiting on. So:

  • No banner on normal runs. A header on stdout is a header in whatever is parsing the other end of the pipe.
  • -V is unchanged — the bare mirsam 0.1.0. Anything parsing it keeps working.
  • The strings come from Cargo metadata (CARGO_PKG_VERSION, CARGO_PKG_LICENSE, CARGO_PKG_REPOSITORY), not a second copy that drifts from Cargo.toml. The year is the only literal, and it matches LICENSE.
  • A bare invocation prints help to stderr and exits 2 (exit::USAGE), leaving stdout empty.

Verification

make fmt-check, make lint and make test all clean — no failures across the suite. Output of -V, --version and the no-argument case checked by hand, including that stdout is empty for the last.

`--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.
@aenawi
aenawi merged commit 8ad3806 into main Sep 5, 2026
7 checks passed
@aenawi
aenawi deleted the cli-version-attribution branch September 5, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant