summaryrefslogtreecommitdiffstats
path: root/src/options.rs
diff options
context:
space:
mode:
authorSebastian Thiel <sebastian.thiel@icloud.com>2021-10-26 20:11:46 +0800
committerSebastian Thiel <sebastian.thiel@icloud.com>2021-10-26 20:13:55 +0800
commitf26309c91a271f1c2c32dfb55dbbb8c713f5e97d (patch)
tree58ea7c653f0bd0677ff3e2e278b8e3dc14881e6b /src/options.rs
parenta0625fc7070efbca360176aef1a522d2290da086 (diff)
fix: cargo install without --locked should work now (#111)
Diffstat (limited to 'src/options.rs')
-rw-r--r--src/options.rs16
1 files changed, 10 insertions, 6 deletions
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")]