You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fixes a bug in the end-of-options functionality - #18408
This PR fixes a bug in the end-of-options-- functionality when used with --wrapped. Previously if -- was used with a custom command with --wrapped the code didn't set end_of_options = true properly. So, other --flags=boo would still be passed as flags instead of passing them through.
User-facing changes (Release notes)
Fixed a bug in -- option parsing
Fixed a bug with how -- was handled with --wrapped custom commands. Now you can do things like this:
I tried it while it works there are some things I'm not so sure about. The -- is being treated as end of options but at the same time it is being forwarded. I don't believe this is very consistent. In my implementation #18406 where it adds --coerce avoids this inconsistency.
Futhermore, I can avoid boilterplate code:
let rest = $rest | skip 1
Is there some reason you want to avoid my implementation?
The -- isn't a regular argument, it's a control token. Passing it through is inconsistent with also using it to stop flag parsing. If it's truly just "pass everything through", then it shouldn't affect flag parsing either. But it does both, which is the inconsistency.
Either -- means something (end of options, consumed silently) or it's just another string passed through, it's hard to justify both at once.
So --wrapped should stay as is, and a separate flag like --coerce (or named differently) handles this case explicitly.
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
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.
Description
This PR fixes a bug in the
end-of-options--functionality when used with--wrapped. Previously if--was used with a custom command with--wrappedthe code didn't setend_of_options = trueproperly. So, other --flags=boo would still be passed as flags instead of passing them through.User-facing changes (Release notes)
Fixed a bug in
--option parsingFixed a bug with how
--was handled with--wrappedcustom commands. Now you can do things like this:Additional notes
Closes #18399