Parse options without names vector#81
Merged
KodrAus merged 1 commit intorust-lang:masterfrom May 17, 2019
Merged
Conversation
KodrAus
approved these changes
May 17, 2019
Contributor
KodrAus
left a comment
There was a problem hiding this comment.
Thanks for cleaning this up @jridgewell
Contributor
|
Looks like we've got some merge conflicts to sort out. Are you happy to take a look at these @jridgewell? |
The only time the names vector has more than one `Name` in it is when parsing contiguous short options (`-abc`). We would continue putting `Name`s into the vector until we hit a short option that takes an argument. At that point, we break, so we can process the argument. So there's no point to reprocess the head of that vector, we already know they don't take arguments. Only the last one matters.
a592b66 to
dffd3f0
Compare
Contributor
Author
|
Rebased. Should be good to merge now. |
KodrAus
approved these changes
May 17, 2019
alexcrichton
added a commit
to alexcrichton/getopts
that referenced
this pull request
Aug 19, 2019
This commit reverts three recent PRs to the `getopts` crate. One of the main consumers of `getopts` is `rustc`, which isn't allowed to have breaking changes. In rust-lang#82, however, a breaking change was landed. It looks like rust-lang#83 builds on this change, and while rust-lang#81 seems unrelated the diffs were somewhat tangled.
Merged
alexcrichton
added a commit
that referenced
this pull request
Aug 19, 2019
alexcrichton
added a commit
that referenced
this pull request
Aug 19, 2019
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.
The only time the names vector has more than one
Namein it is when parsing contiguous short options (-abc). We would continue puttingNames into the vector until we hit a short option that takes an argument. At that point, we break, so we can process the argument.So there's no point to reprocess the head of that vector, we already know they don't take arguments. Only the last one matters.