bash-completion: update and improve supported completion cases
Metadata
Current evaluation
Completion work in canonical/snapcraft#4559 was closed as stale and superseded by canonical/craft-cli#319, merged in commit 4d41d7d with generated Bash completion.
Resolution: closed superseded
Reason: The maintainer closed the stale PR because its hand-written completion script would be replaced. canonical/craft-cli#319 implemented generated Bash completion and merged as commit 4d41d7d.
Evaluated by: mr-cal-bot
No scores available.
Issue body
multiple improvements to the completion logic
- add multiple new commands,
- replace `snap` with `pack`
- add supported architectures for `--target-arch` and `--build-for`
- do not parse `snapcraft.yaml` as the format changes between core20 and core22 bases, and we have only a list of predefined options regardless, use those.
- build | clean | pull | stage | prime: parse `snapcraft.yaml` for suggested parts
- use `shell`/`sed` based custom parser. we do not want to bring yq as an extra dependency, and calling back to the python parser demonstrated to be very slow
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed superseded | Completion work in canonical/snapcraft#4559 was closed as stale and superseded by canonical/craft-cli#319, merged in commit 4d41d7d with generated Bash completion. | |
| stealth/space-bunny-alpha | — | closed stale | Closed unmerged as stale after inactivity; its bash-completion script was to be replaced by canonical/craft-cli#319, which later merged generated completion support. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed as stale. The bash-completion script will be superseded by @bepri's solution in canonical/craft-cli#319. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Updated bash-completion with new commands, architecture flags, and a faster sed-based parser for snapcraft.yaml. Tests passed. PR closed as stale and superseded by a completion implementation in craft-cli PR #319. |
Update history
No update history recorded yet.
Related work
-
Superseded By:
canonical/craft-cli#319
(confidence 99%)
The closing comment explicitly identifies this merged PR as the replacement for snapcraft#4559.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #5022 Bash completion script is outdated | snapcraft | closed | Snapcraft 8.7 replaced the stale manual Bash completion with an automatically generated script tracking current commands and options in merged PR #5218 (387202653). | |
| #1390 meta: bash completion support | snapcraft | merged | Merged PR #1390 added bash completion support for snapcraft and snapcraft metadata, landing as commit 2d01bc112. | |
| #211 Generate bash completion for the application | craft-cli | closed | Bash completion generation was implemented and released in craft-cli 2.14.0 by merged PR canonical/craft-cli#319 (commit 4d41d7d). | |
| #5218 feat: add improved bash completion script | snapcraft | merged | Merged in #5218 (commit 387202653), replacing the manually maintained Bash completion with a dynamically generated script that tracks current commands and options; shipped in Snapcraft 8.7. | |
| #1570506 Snapcraft should use bash-completion | snapcraft (launchpad) | closed | Added bash-completion support to snapcraft via merged upstream PR #453 (commit 6ea95fd50, changelog 16e1a9d76). Shipped in snapcraft 2.9 SRU to xenial; verified by elopio and released to -updates on 2016-05-30. | |
| #453 Add in bash completion | snapcraft | merged | Merged PR #453 via commit 6ea95fd50, adding a simple Bash completion script for Snapcraft commands. | |
| #231 [EXPERIMENTAL] shell completion | craft-cli | closed | Closed unmerged after inactivity; a redesigned Bash-completion feature later landed via canonical/craft-cli#319 (4d41d7d), closing #211. | |
| #1646213 Code completion for *.snap on the cli is broken | snapcraft (launchpad) | closed | Fixed by merged canonical/snapcraft#933 (commit 5c41e4bc), which corrected Bash completion for .snap files containing multiple dots. | |
| #222 Modernize the Bash completion definition. | charmcraft | merged | PR #222 modernized Charmcraft's Bash completion definition and was merged into master, with a noted lack of automated drift testing. | |
| #2111 feat: add improved bash completion script | charmcraft | merged | Merged charmcraft#2111 in commit d5a4b704, replacing Charmcraft’s legacy Bash completion with an improved script generated through craft-cli completion tooling. |