← Back to issue list

fix(legacy-cli): restore --version flag and minimal version subcommand

View original Github issue

Metadata

Project
snapcraft
Number
#5778
Type
pull request
State
closed
Author
Nalin-Kumar-Gupta
Labels
—
Created
Updated
Closed

Current evaluation

PR #5778 was closed unmerged: restoring the legacy version CLI was deemed dead code because snap-packaged Snapcraft does not expose that Python entry point.

Resolution: closed not a bug

Reason: Maintainer @bepri explained on 2025-10-10 that the passing Pytest scenario used a legacy entry point unavailable in Snapcraft's exclusively distributed snap, so no compatibility restoration was needed.

Evaluated by: mr-cal-bot

No scores available.

Issue body

## Summary Fixes integration test failures caused by removing the `--version` flag when legacy help/version commands were removed. ## Changes - ✅ Restored `@click.version_option` decorator to handle `snapcraft --version` - ✅ Added minimal `version` subcommand for backward compatibility - ✅ Maintains removal of legacy help/version command implementations - ✅ Fixes failing integration test: `tests/spread/core24-suites/manifest/manifest-creation/task.yaml` ## Root Cause The original removal of help/version commands also removed the `--version` flag handling, which broke integration tests that rely on `snapcraft --version` working. ## Testing - Integration test `manifest-creation` should now pass - Both `snapcraft --version` and `snapcraft version` work correctly - No complex help functionality restored (only minimal version support) - [x] Have you followed the [guidelines for contributing](https://github.com/canonical/snapcraft/blob/main/CONTRIBUTING.md)? - [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [x] Have you successfully run `make lint`? - [x] Have you successfully run `make test`? ---

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed not a bug PR #5778 was closed unmerged: restoring the legacy version CLI was deemed dead code because snap-packaged Snapcraft does not expose that Python entry point.
stealth/space-bunny-alpha — closed not a bug Closed unmerged after review found the proposed legacy version compatibility was dead code: the distributed snap does not expose the legacy Python entry point.
stealth/space-bunny-alpha — closed not a bug Closed unmerged: maintainer determined the proposed --version/version compatibility was dead code because the distributed snap does not expose the legacy Python entry point.
qwen/qwen3.6-35b-a3b — — Closed without merging. The changes were rejected as dead code; Snapcraft is exclusively distributed as a snap package, making the restored version flag and subcommand unnecessary for end users.
qwen3.6-35b-a3b-mtp-q6 — — Closed without merging. Reviewers clarified the failing test relied on a dead legacy entry point, as Snapcraft distributes exclusively as a snap. The proposed version flag restoration was deemed unnecessary, and the PR was rejected.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.