-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #6076 - matthiaskrgr:version_verbose, r=dwijnand
cargo version: support --verbose make obtaining of the version output an own function and use it in the "version" subcommand makes "cargo version -v" work equivalent to "cargo -Vv"
- Loading branch information
Showing
2 changed files
with
26 additions
and
17 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
use command_prelude::*; | ||
|
||
use cargo; | ||
use cli; | ||
|
||
pub fn cli() -> App { | ||
subcommand("version").about("Show version information") | ||
} | ||
|
||
pub fn exec(_config: &mut Config, _args: &ArgMatches) -> CliResult { | ||
println!("{}", cargo::version()); | ||
pub fn exec(_config: &mut Config, args: &ArgMatches) -> CliResult { | ||
let verbose = args.occurrences_of("verbose") > 0; | ||
let version = cli::get_version_string(verbose); | ||
print!("{}", version); | ||
Ok(()) | ||
} |