Skip to content

feat(cli): add --version to modscan and modscan-audit - #80

Merged
Rinkia merged 1 commit into
masterfrom
feat/cli-version
Jul 24, 2026
Merged

Rinkia merged 1 commit into
masterfrom
feat/cli-version

Conversation

@Rinkia

@Rinkia Rinkia commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Closes #16.

What

modscan --version and modscan-audit --version print the version and exit 0.

Read from package metadata via modscan.__version__, never hardcoded, so it cannot drift from pyproject.toml. A source checkout that was never installed reports 0.0.0+unknown rather than asserting a version it cannot know.

One deliberate step beyond the issue

The issue asked only for the main CLI. modscan-audit is included too — 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 as well.

Test plan

  • tests/test_cli.py::test_version_flag_prints_and_exits_zero — both entry points, asserts SystemExit(0) and exact output "<prog> <version>", plus a guard that the value is metadata-derived rather than a hardcoded literal.
  • Suite 26/26; benchmark 15/29 unchanged.
  • Framework-free style (catches SystemExit, no pytest).

Acceptance (from the issue)

  • prints modscan <version> and exits 0
  • version read from package metadata, not hardcoded
  • a test covers it; full suite passes
  • no new .py files, so no new headers needed

🤖 Generated with Claude Code

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>
@github-actions

Copy link
Copy Markdown

MODScan extension-point diff

No breaking changes to extension points

@github-actions

Copy link
Copy Markdown

MODScan attack-surface diff — modscan

No new execution sinks

New attack surface to review — NOT a vulnerability verdict. This compares enumerated execution sinks between two snapshots. It does not trace whether input reaches them (no taint analysis), match CVEs, or detect secrets. An empty diff means no new catalogued sinks — not that the change is safe.

The two snapshots enumerate the same execution sinks.

@Rinkia
Rinkia merged commit c24d498 into master Jul 24, 2026
7 checks passed
@Rinkia
Rinkia deleted the feat/cli-version branch July 24, 2026 08:40
@Rinkia Rinkia mentioned this pull request Sep 8, 2026
4 tasks done
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.

Add a --version flag to the CLI

1 participant