Skip to content

fix(cli): reject unknown completion shells#303

Merged
upsetbit merged 1 commit into
masterfrom
codex/fix-completion-shell-validation
Jun 27, 2026
Merged

fix(cli): reject unknown completion shells#303
upsetbit merged 1 commit into
masterfrom
codex/fix-completion-shell-validation

Conversation

@upsetbit

Copy link
Copy Markdown
Contributor

Summary

Fixes #298.

Rejects unknown shells passed to prosa completion instead of printing completion help with exit 0.

What changed

  • Initializes Cobra's default completion command during root command construction.
  • Adds validation for the supported shells: bash, zsh, fish, and powershell.
  • Keeps prosa completion without a shell as a help-only command with exit 0.

Validation

  • go test ./internal/cli -run 'TestCompletion|TestParentCommandsRequireExplicitSubcommands' -count=1
  • go test ./internal/cli/... -race
  • go build -o ./bin/prosa ./cmd/prosa
  • Manual checks for prosa completion wat, prosa completion, and prosa completion bash

@upsetbit upsetbit added bug Something isn't working area:cli prosa CLI scope:cli prosa CLI commands, flags, rendering, setup, and scheduled sync severity:medium Latent bug, inconsistent contract, brittle pattern priority:P2 Lower-priority cleanup, coverage, polish, or follow-up source:audit Created from an audit report or validation pass labels Jun 27, 2026
@upsetbit upsetbit merged commit 3c8eacb into master Jun 27, 2026
4 checks passed
@upsetbit upsetbit deleted the codex/fix-completion-shell-validation branch June 27, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:cli prosa CLI bug Something isn't working priority:P2 Lower-priority cleanup, coverage, polish, or follow-up scope:cli prosa CLI commands, flags, rendering, setup, and scheduled sync severity:medium Latent bug, inconsistent contract, brittle pattern source:audit Created from an audit report or validation pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

completion accepts an unknown shell with exit 0

1 participant