Skip to content

fix(cli): accept --completions powershell, keep power-shell as an alias - #642

Merged
LargeModGames merged 1 commit into
LargeModGames:mainfrom
kapok-4o:fix/completions-powershell
Sep 28, 2026
Merged

LargeModGames merged 1 commit into
LargeModGames:mainfrom
kapok-4o:fix/completions-powershell

Conversation

@kapok-4o

@kapok-4o kapok-4o commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes #606. --completions now lists powershell and keeps power-shell as a clap alias (PossibleValue::new("powershell").alias("power-shell"), with every entry wrapped in PossibleValue). clap passes the value as typed, so the mapping, moved into a pure completion_shell in src/runtime/mod.rs, matches "powershell" | "power-shell". README.md is unchanged.

Tests: completions_accepts_powershell, completions_still_accepts_the_old_power_shell_spelling, completions_rejects_an_unknown_shell in runtime/cli.rs, and the optional completion_shell_maps_both_powershell_spellings in runtime/mod.rs.

Testing

  • cargo fmt --all -- --check: clean
  • cargo clippy --no-default-features --features telemetry,tui -- -D warnings: clean
  • cargo test --no-default-features --features telemetry,tui: 1313 passed, 0 failed
  • cargo test --no-default-features --features telemetry,tui completion: 4 passed
  • With powershell removed again, completions_accepts_powershell and completion_shell_maps_both_powershell_spellings fail.
  • Ran the slim binary on macOS: --completions powershell and --completions power-shell both print the same 319-line PowerShell script, --completions nushell exits 2 with the invalid-value error, and --help lists [possible values: bash, zsh, fish, powershell, elvish].

Additional notes

This is one of five small PRs I opened together (for #606, #598, #597, #596 and #601). Each changelog entry sits at a different spot in [Unreleased], and I test-merged all five in three orders without conflicts; together they pass the slim checks (1327 tests).

Written with AI coding assistants: Codex drafted fixes for these issues, and Claude Code rebuilt each one on current main against the issue text and re-tested it.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • The --completions option now accepts powershell as well as the existing power-shell spelling. Other supported shells and handling of unsupported names remain unchanged.

… alias

Only the spotify-tui spelling `power-shell` parsed, so the documented
`powershell` failed with an invalid-value error. List `powershell` and
keep `power-shell` as a clap alias. clap passes the value as typed, so
the mapping in run_cli, now the pure completion_shell, matches both.

Fixes LargeModGames#606

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: LargeModGames/spotatui/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 489b84a2-41bb-4225-97b9-c605a4fc8b32

📥 Commits

Reviewing files that changed from the base of the PR and between ea356a0 and 19357e5.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • src/runtime/cli.rs
  • src/runtime/mod.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The completion parser now accepts powershell and retains power-shell as an alias. Runtime mapping and tests cover both spellings. The changelog records the change.

Changes

Completion shell parsing

Layer / File(s) Summary
Accepted completion values
src/runtime/cli.rs, CHANGELOG.md
The CLI accepts powershell as the canonical value and retains power-shell. Tests cover both spellings and rejection of nushell. The changelog records the accepted spelling.
Runtime shell mapping
src/runtime/mod.rs
Runtime maps both PowerShell spellings to Shell::PowerShell. Tests cover both spellings and rejection of an unsupported name.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 19357

Both documented PowerShell spellings are supported, and the other completion choices remain intact. No merge-blocking risk was found.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 19357

The change adds the expected PowerShell spelling while keeping the old spelling working. No new security path was identified, although the available security coverage is incomplete.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The newly accepted input reaches the existing local completion-output path, rather than the later application-boot path.

Trust Boundaries and Controls

  • observed — CLI-supplied shell names are constrained by the parser allowlist and then matched by the runtime mapper; unknown names are not mapped to a completion shell.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title uses the allowed conventional-commit prefix fix(cli):. It clearly and concisely describes the main change, including support for powershell and retention of power-shell as an alias.
Linked Issues check ✅ Passed Issue #606 requires powershell acceptance, power-shell compatibility, rejection of unknown names, PowerShell mapping, and automated tests. src/runtime/cli.rs lists powershell with `power-shell…
Out of Scope Changes check ✅ Passed The reviewed changes stay within issue #606. The CLI parser, mapping function, focused tests, and the changelog entry all document or implement the requested completion spelling and compatibility beha…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
✨ Simplify code
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Sep 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.23810% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/runtime/mod.rs 87.5% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@LargeModGames
LargeModGames merged commit 5bdbd59 into LargeModGames:main Sep 28, 2026
31 checks passed
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.

--completions powershell is rejected, only power-shell parses

2 participants