Skip to content

feat: Add --version to every command - #35

Merged
bougyman merged 1 commit into
mainfrom
feat/version
Oct 4, 2026
Merged

bougyman merged 1 commit into
mainfrom
feat/version

Conversation

@ruby-automation

Copy link
Copy Markdown
Collaborator

Every command takes --version, and sv-helper also takes a version subcommand:

$ sv-helper --version
sv-helper 4.1.0
$ svls --version
svls (sv-helper) 4.1.0
$ rsvlog --version
rsvlog (sv-helper) 4.1.0
$ runsvdir.sh --version
runsvdir.sh (sv-helper) 4.1.0

The format is GNU style. Through an alias, the output names the package the alias belongs to.

Each command answers before doing anything else:

  • rsvlog --version works outside a log directory, ahead of its ./run-only checks.
  • runsvdir.sh --version never resolves, creates or supervises a tree.
  • A regular user's svls --version creates nothing under $HOME.

Where the version comes from

An installed script has no version.txt beside it, so each script carries its own sv_version=... # x-release-please-version line. All three scripts are added to release-please's extra-files, next to PKGBUILD. So is the README's example, which uses the block markers (checked against release-please's docs/customizing.md).

test/version.bats fails if a file carrying a marker is missing from extra-files, or holds a version other than version.txt's. I broke each check on purpose to confirm it fails. docs/releasing.md explains how this works.

make test passes locally (114 tests).

🤖 Generated with Claude Code

sv-helper and every alias (svls, sv-enable and the rest), rsvlog and
runsvdir.sh all take --version. sv-helper also takes a `version`
subcommand. Output is GNU style: `sv-helper 4.1.0` by its own name,
`svls (sv-helper) 4.1.0` through an alias.

Each is answered before anything else runs. rsvlog answers outside a
log directory. runsvdir.sh never resolves, creates or supervises a
tree. A regular user's svls creates nothing.

An installed script has no version.txt beside it, so each script
carries its own version, on a line release-please rewrites through
the x-release-please-version marker. The scripts and the README's
example are added to extra-files. test/version.bats fails if a marked
file is missing from extra-files, or holds a version other than
version.txt's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bougyman
bougyman merged commit 3a46b60 into main Oct 4, 2026
2 checks passed
@bougyman
bougyman deleted the feat/version branch October 4, 2026 23:26
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.

2 participants