Repository navigation
fix(mcpx): quote zsh completion _describe entries so the script parses - #273
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 2
✨ Finishing Touches
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #272. Port of dezren39/nix PR #379 (dezren39/darwin-nix#365) — the same defect in this repo's
pkgs/mcpxcopy:zshCompletionemitted each_describecommands entry unquoted, so summaries with apostrophes (server'\''s prompts), parens and glob brackets made the generated script unparseable.internal/cli/completion.go: each commands entry is now emitted single-quoted ('%s:%s') via a newzshDescribehelper, which only handles_describe's own syntax (backslash-escapes:in the description,'\''for apostrophes).zshEscapeis unchanged and still used for the flag-description sites, which are already inside single quotes. The two files are byte-identical to nix's post-fix versions except the issue reference (mcpx docs: story.md's AGENTS.md claims are stale again (109 vs 120 lines) and no test guards them #365 → mcpx: zsh completion script fails to parse (unquoted _describe entries) #272).internal/cli/completion_test.go(new, ported): every commands entry is single-quoted, an apostrophe-bearing entry is present, andzshDescribeescapes colons/quotes.Verified locally:
mcpx completion zsh | zsh -n→parse error near ';;'(exit 1). With the fix:zsh -nexit 0,bash -nexit 0 (fish is not installed in the sandbox; fish generation is untouched by this change).go test ./internal/cli/— full suite green, including the 2 new tests.TestZshCompletionCommandsAreQuotedfail with unquoted entries; restored, it passes.go vet ./internal/cli/clean;completion.gogofmt-clean (the test file lists under the sandbox's Go 1.25 gofmt exactly like the nix original and several untouched files — the repo's CI gofmt is Go 1.27 from nix-common.nix).Summary by CodeRabbit