-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vendor: Document how to terminate --sync list #10441
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is really the best way to convey how command-line arguments work. Adding a bare
--
prevents specifying other options, it doesn't just terminate the--sync
arguments.It's a bit unfortunate that
--sync
was defined withmultiple_values
defined, as this is a bit of a footgun. It would almost be nice to remove that, but I'm not sure if that is really feasible. @alexcrichton or @epage do you have any thoughts on that?I wonder if cargo could maybe detect this situation and provide a better error message? That is, if one of the
--sync
arguments is not aCargo.toml
, it could give a suggestion?Otherwise, maybe this could use a few more words to specify that "if you are specifying an output directory, then include a separate
--
argument to separate …". Something along those lines, I'm not sure how to word it clearly.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, getting rid of
multiple_values
is definitely the right thing to do, but I didn't feel comfortable making a UI-incompatible change. Best I could think of was documenting it.I didn't realize the terminator killed parsing entirely. Is that also true if we specify
value_terminator
in the declaration for the--sync
option?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh dear yeah it was never intended that
--foo bar baz
is considered for Cargo, that's definitely an antipattern we wouldn't ever actually opt-in to. I would hope thatcargo vendor
isn't so widely used we could just fix it and consider it a bugfixThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're OK with changing the UI, then I've opened #10448 to do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I briefly reviewed all other usages of
multiple_values
and they all look OK to me (mostly argument lists, some spec lists, but nothing like cargo-vendor where it could eat a following significant argument).