fix(cli): add --no-descriptions flag to completion subcommands#5771
Draft
Coly010 wants to merge 2 commits into
Draft
fix(cli): add --no-descriptions flag to completion subcommands#5771Coly010 wants to merge 2 commits into
Coly010 wants to merge 2 commits into
Conversation
cobra auto-registers --no-descriptions on all four completion subcommands whenever descriptions are enabled (the Go CLI default). The TS proxies declared no flags at all, so the Effect CLI parser rejected the flag with UnrecognizedOption before it ever reached the Go binary. Hoisted the flag definition into completion.flags.ts since it's shared by all four leaves in the same family. Fixes CLI-1858
The original fix only had handler-level tests, which call the handler function directly and never exercise the Effect CLI parser — so a dropped flag declaration in a command.ts config would silently regress without failing any test. - Add Command.runWith parser-level tests for bash/zsh/fish/powershell that parse real argv through the actual command definitions. - Add a real-subprocess e2e test proving --no-descriptions survives Effect's parser and is forwarded to the Go binary (asserted via the __completeNoDesc marker Cobra embeds in the generated script). - Note the --no-no-descriptions double-negation quirk from Effect's auto-derived --no-<flag> negation. - Fix a stale __complete/ directory reference in SIDE_EFFECTS.md and note the flag addition in the porting status doc.
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.
Current Behavior
cobra auto-registers a
--no-descriptionsflag on thebash/zsh/fish/powershellcompletion subcommands whenever descriptions are enabled, which is the Go CLI's default. The TS proxy commands declared no flags at all, sosupabase completion zsh --no-descriptions(and the other three shells) failed with an UnrecognizedOption error in TS before ever reaching the Go binary.Expected Behavior
Each of the four completion leaves now declares
--no-descriptions(name, default, and description matching cobra'scompCmdNoDescFlagName/compCmdNoDescFlagDefault/compCmdNoDescFlagDescconstants exactly) and forwards it to the Go binary proxy. Since the flag is identical across all four leaves in the same command family, it's hoisted intocompletion.flags.tsrather than redeclared four times, following the same pattern already used for--linked/--localinstorage.flags.ts.Fixes CLI-1858