fix: avoid executing actions when completing -- in v2#2379
Open
happysnaker wants to merge 2 commits into
Open
Conversation
Author
|
Quick follow-up after checking the latest PR runs: the behavior change itself is covered by the new regression tests and the substantive remaining failure is the existing binary-size gate on the v2 test workflow ( If you would prefer, I can try a follow-up commit that trims this patch further or moves the guard/test shape around to see whether it avoids the binary-size bump. |
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.
What type of PR is this?
What this PR does / why we need it:
Prevents
--generate-bash-completionfrom falling back to normal command execution when the user is completing after--in v2.The change keeps the existing v2 behavior that disables completion after a positional separator that already appeared earlier, but trims the completion flag before normal dispatch so the command action is not executed accidentally.
It also preserves completing
--itself, which allows the shell script to request long-flag suggestions without running the action.Which issue(s) this PR fixes:
Fixes #1993
Special notes for your reviewer:
I kept this intentionally minimal for
v2-maint:--App.RunTesting
Added regression tests for:
checkShellCompleteFlagwhen--is the token being completedcheckShellCompleteFlagwhen--already appeared before completionApp.Runto ensure double-dash completion does not execute the actionRelease Notes