-
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
cargo install
should accept --version (in addition to --vers?)
#4590
Comments
Unfortunately |
It appears that
|
Heh, I'd consider that a bug! |
It's not unique:
Can we make lemonade out of this lemon and only support |
Hm I suppose so yeah! |
A quick skim through all the built-in subcommands shows they all have the same behavior. Cleaned-up output of all commands
Third-party cargo subcommands do frequently support |
lol |
It's real easy to fix this naïvely: diff --git a/src/bin/install.rs b/src/bin/install.rs
index c7062d40..35a09a74 100644
--- a/src/bin/install.rs
+++ b/src/bin/install.rs
@@ -23,7 +23,7 @@ pub struct Options {
flag_locked: bool,
arg_crate: Vec<String>,
- flag_vers: Option<String>,
+ flag_version: Option<String>,
flag_git: Option<String>,
flag_branch: Option<String>,
@@ -43,7 +43,7 @@ Usage:
cargo install [options] --list
Specifying what crate to install:
- --vers VERS Specify a version to install from crates.io
+ --version VERSION Specify a version to install from crates.io
--git URL Git URL to install the specified crate from
--branch BRANCH Branch to use when installing from git
--tag TAG Tag to use when installing from git
@@ -151,7 +151,7 @@ pub fn execute(options: Options, config: &mut Config) -> CliResult {
};
let krates = options.arg_crate.iter().map(|s| &s[..]).collect::<Vec<_>>();
- let vers = options.flag_vers.as_ref().map(|s| &s[..]);
+ let vers = options.flag_version.as_ref().map(|s| &s[..]);
let root = options.flag_root.as_ref().map(|s| &s[..]); The problem is we probably want to support |
@kivikakk that looks fine to me, but I don't think we'll want to deprecate the |
@alexcrichton agreed! Showing both in the USAGE feels a bit gross, is all. I'll see how it looks in practice. |
Allow cargo install --version as well (preferred) Fixes #4590. The usage looks pretty ugly with this extra line in it, but it's not really avoidable with our docopt use. We fail if both are provided; accepting both feels like a path to demons.
It's a long command line option; it shouldn't be needlessly truncated.
The text was updated successfully, but these errors were encountered: