Skip to content
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

Overly permissive docopt allows mutually exclusive package kinds #174

Closed
bjgill opened this issue Oct 15, 2017 · 1 comment
Closed

Overly permissive docopt allows mutually exclusive package kinds #174

bjgill opened this issue Oct 15, 2017 · 1 comment

Comments

@bjgill
Copy link
Collaborator

bjgill commented Oct 15, 2017

Whilst debugging for #173, I discovered that it was possible to run cargo add failure --vers 0.4.3 --git git://git.git --path /path/here.

This exited successfully, having added failure = 0.0.1 to the manifest.

Printing out the docopt arguments yielded:

Args { arg_crate: "", arg_crates: ["failure"], flag_dev: false, flag_build: false, flag_vers: Some("0.4.3"), flag_git: Some("git://git.git"), flag_path: Some("/path/here"), flag_target: None, flag_optional: false, flag_manifest_path: None, flag_version: false, flag_upgrade: None, flag_allow_prerelease: false }

The browser-based version on http://docopt.org/ correctly rejects cargo add failure --vers 0.4.3 --git git://git.git --path /path/here. Thus, I suspect that this is likely to be a failure in the Rust implementation of docopt.

I'm planning to raise an issue with docopt-rs, linking back here.

I've got a test on a branch that should start succeeding when this issue is fixed: https://github.com/bjgill/cargo-edit/tree/docopt-failure.

@ordian
Copy link
Collaborator

ordian commented Oct 27, 2019

We've switched to structopt, closing as stale.

@ordian ordian closed this as completed Oct 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants