cli: add version command
Metadata
Current evaluation
Merged in snapcraft#1746 via commit 0820103ae, adding snapcraft version and snapcraft --version with matching output and tests.
Resolution: closed resolved
Reason: The approved PR was merged as commit 0820103ae. It implemented both version invocation forms, aligned their output, and added regression tests.
Evaluated by: mr-cal-bot
No scores available.
Issue body
* As discussed in [LP #1590349](https://bugs.launchpad.net/snapcraft/+bug/1590349), snapcraft should return the version
number when called like snapcraft version and snapcraft --version.
- [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [x] If this is a bugfix. Have you checked that there is a bug report open for the issue you are trying to fix on [bug reports](https://bugs.launchpad.net/snapcraft)?
- [x] If this is a new feature. Have you discussed the design on the [forum](https://forum.snapcraft.io)?
- [x] Have you successfully run `./runtests.sh static`?
- [x] Have you successfully run `./runtests.sh unit`?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged in snapcraft#1746 via commit 0820103ae, adding snapcraft version and snapcraft --version with matching output and tests. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged in snapcraft#1746 via commit 0820103ae, adding snapcraft version and snapcraft --version support with consistent output and tests. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #1746 in commit 0820103ae, adding snapcraft version and --version support with consistent output and tests. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged after reviewer approval and passing CI. Adds a CLI version command to snapcraft, resolving feedback on click message parameters, type checking, and whitespace before final merge. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged to add snapcraft version and snapcraft --version CLI commands. Implementation uses Click's version_option with a custom message. Static analysis, type checking, and whitespace issues were resolved during review before integration. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1366 cli: Add --version command | snapcraft | merged | Merged in snapcraft#1366 as commit be4a92ad7, adding a global --version flag; the fix was expected in Snapcraft 2.32. | |
| #3626 cli: integrate craft-cli and add version command (CRAFT-730) | snapcraft | merged | Merged into snapcraft 7.0 via commit 0457d6572: integrated craft-cli, added the version command, and retained the legacy CLI fallback for other commands. | |
| #1590349 snapcraft should have a 'version' command | snapcraft (launchpad) | closed | Added the version subcommand via snapcore/snapcraft PR #1746 (commit 0820103ae); the change was merged and released in Snapcraft 2.40. | |
| #1692752 snapcraft 2.30 has no version command | snapcraft (launchpad) | closed | Resolved by merged PR canonical/snapcraft#1366 (commit be4a92ad7), adding global snapcraft --version; expected in Snapcraft 2.32. | |
| #2063 many: add snapcraftctl set-version | snapcraft | merged | Merged as commit 278f9b79f, adding snapcraftctl set-version for scriptlets and reusable setter infrastructure; resolves #1676. |