Repository navigation
fix(parser): pass -Zscript and -j8 through to a known external - #19642
Merged
Merged
Conversation
…(parser): pass `-Zscript` and `-j8` through to a known external
2 tasks done
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.
Description
generate completions cargodeclares-Z: string, and with that extern loaded,cargo -Zscript foo.rsfailed withonly_last_flag_in_batch_can_take_arg.^cargo -Zscriptandcargo -Z scriptboth worked.make -j8andgit commit -amffailed the same way under their externs.git commit -amfis the example in #5923, which #8808 closed by letting the last flag in a batch take the next word. The attached form never worked.A known external now reads short flags the way
getoptdoes. When a flag that takes a value comes before the end of the word, the rest of the word is its value, and the word goes to the program as written. Nushell still checks that value against the flag's type, so-jabcwith-j: intfails like-j abcdoes.extern --strictaccepts the word when every flag in it is declared. Nushell commands anddef --wrappedkeep the old rule.User-facing changes (Release notes)
Commands declared with
externaccept a short flag with its value attached, such ascargo -Zscript,make -j8orgit commit -amf, and pass it to the program as written.Additional notes
closes #19639
$or(skip the type check. Inside the word,-Z$xstays literal and-Z(1 + 2)becomes-Z3, so checking$xor(1 + 2)alone would test something the program never gets.-éjm 5the-jtook a value without being last. It now compares spans.