diff options
author | Sebastian Thiel <sebastian.thiel@icloud.com> | 2021-10-26 20:11:46 +0800 |
---|---|---|
committer | Sebastian Thiel <sebastian.thiel@icloud.com> | 2021-10-26 20:13:55 +0800 |
commit | f26309c91a271f1c2c32dfb55dbbb8c713f5e97d (patch) | |
tree | 58ea7c653f0bd0677ff3e2e278b8e3dc14881e6b /src | |
parent | a0625fc7070efbca360176aef1a522d2290da086 (diff) |
fix: cargo install without --locked should work now (#111)
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 2 | ||||
-rw-r--r-- | src/options.rs | 16 |
2 files changed, 11 insertions, 7 deletions
diff --git a/src/main.rs b/src/main.rs index 5da8e0f..d116bbd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,6 @@ #![forbid(unsafe_code)] use anyhow::Result; -use clap::Clap; +use clap::Parser; use dua::{ByteFormat, TraversalSorting}; use std::{fs, io, io::Write, path::PathBuf, process}; diff --git a/src/options.rs b/src/options.rs index 12354f1..8c7c35e 100644 --- a/src/options.rs +++ b/src/options.rs @@ -1,4 +1,3 @@ -use clap::Clap; use dua::ByteFormat as LibraryByteFormat; use std::path::PathBuf; use std::str::FromStr; @@ -50,10 +49,8 @@ impl From<ByteFormat> for LibraryByteFormat { } } -#[derive(Debug, Clap)] +#[derive(Debug, clap::Parser)] #[clap(name = "dua", about = "A tool to learn about disk usage, fast!", version = clap::crate_version!())] -#[clap(setting = clap::AppSettings::ColoredHelp)] -#[clap(setting = clap::AppSettings::DisableVersionForSubcommands)] #[clap(override_usage = "dua [FLAGS] [OPTIONS] [SUBCOMMAND] [input]...")] pub struct Args { #[clap(subcommand)] @@ -72,7 +69,12 @@ pub struct Args { /// GiB - only gibibytes /// MB - only megabytes /// MiB - only mebibytes - #[clap(short = 'f', long, case_insensitive = true, possible_values(&ByteFormat::VARIANTS))] + #[clap( + short = 'f', + long, + case_insensitive = true, + possible_values(ByteFormat::VARIANTS) + )] pub format: Option<ByteFormat>, /// Display apparent size instead of disk usage. @@ -92,11 +94,12 @@ pub struct Args { pub input: Vec<PathBuf>, } -#[derive(Debug, Clap)] +#[derive(Debug, clap::Parser)] pub enum Command { /// Launch the terminal user interface #[cfg(any(feature = "tui-unix", feature = "tui-crossplatform"))] #[clap(name = "interactive", visible_alias = "i")] + #[clap(setting = clap::AppSettings::DisableVersionFlag)] Interactive { /// One or more input files or directories. If unset, we will use all entries in the current working directory. #[clap(parse(from_os_str))] @@ -104,6 +107,7 @@ pub enum Command { }, /// Aggregrate the consumed space of one or more directories or files #[clap(name = "aggregate", visible_alias = "a")] + #[clap(setting = clap::AppSettings::DisableVersionFlag)] Aggregate { /// If set, print additional statistics about the file traversal to stderr #[clap(long = "stats")] |