Repository navigation
feat(cli): add --version to modscan and modscan-audit - #80
Merged
Merged
Conversation
Closes #16. Both console scripts now print their version and exit 0. The version is read from package metadata via modscan.__version__ rather than hardcoded, so it cannot drift from pyproject.toml. A source checkout that was never installed reports 0.0.0+unknown instead of asserting a version it cannot know. The issue asked only for the main CLI; modscan-audit is included because a sibling console script that errors on --version is a wart, and it costs two lines. __version__ is exported from the package, so library users get it too. Suite 26/26; benchmark unchanged at 15/29. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
MODScan extension-point diffNo breaking changes to extension points |
MODScan attack-surface diff —
|
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.
Closes #16.
What
modscan --versionandmodscan-audit --versionprint the version and exit 0.Read from package metadata via
modscan.__version__, never hardcoded, so it cannot drift frompyproject.toml. A source checkout that was never installed reports0.0.0+unknownrather than asserting a version it cannot know.One deliberate step beyond the issue
The issue asked only for the main CLI.
modscan-auditis included too — a sibling console script that errors on--versionis a wart, and it costs two lines.__version__is exported from the package, so library users get it as well.Test plan
tests/test_cli.py::test_version_flag_prints_and_exits_zero— both entry points, assertsSystemExit(0)and exact output"<prog> <version>", plus a guard that the value is metadata-derived rather than a hardcoded literal.SystemExit, no pytest).Acceptance (from the issue)
modscan <version>and exits 0.pyfiles, so no new headers needed🤖 Generated with Claude Code