mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-20 20:48:43 +00:00
Add new option Options::quiet
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
62bce2f52f
commit
6685d5a610
1 changed files with 9 additions and 0 deletions
|
@ -162,6 +162,12 @@ struct Options {
|
||||||
value_name = "LEVEL"
|
value_name = "LEVEL"
|
||||||
)]
|
)]
|
||||||
log_level: LevelFilter,
|
log_level: LevelFilter,
|
||||||
|
|
||||||
|
/// Equivalent to setting `log_level` to `off`.
|
||||||
|
///
|
||||||
|
/// This would override the `log_level`.
|
||||||
|
#[clap(help_heading = "Meta", long)]
|
||||||
|
quiet: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
enum MainExit {
|
enum MainExit {
|
||||||
|
@ -235,6 +241,9 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> {
|
||||||
|
|
||||||
// Load options
|
// Load options
|
||||||
let mut opts = Options::parse_from(args);
|
let mut opts = Options::parse_from(args);
|
||||||
|
if opts.quiet {
|
||||||
|
opts.log_level = LevelFilter::Off;
|
||||||
|
}
|
||||||
|
|
||||||
let crate_names = take(&mut opts.crate_names);
|
let crate_names = take(&mut opts.crate_names);
|
||||||
if crate_names.len() > 1 {
|
if crate_names.len() > 1 {
|
||||||
|
|
Loading…
Add table
Reference in a new issue