From db514fe58c234ad312156814ba6f5ee7b7af0b60 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sat, 22 Feb 2020 13:48:16 +0800 Subject: Rename 'count-links' to more descriptive 'count-hard-links' --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/aggregate.rs | 2 +- src/common.rs | 2 +- src/interactive/app_test/utils.rs | 2 +- src/main.rs | 2 +- src/options.rs | 12 ++++++------ src/traverse.rs | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2519882..302d8c2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -185,7 +185,7 @@ checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" [[package]] name = "dua-cli" -version = "2.2.1-alpha.0" +version = "2.3.0" dependencies = [ "atty", "byte-unit", diff --git a/Cargo.toml b/Cargo.toml index b23807b..8a21b65 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dua-cli" -version = "2.2.1-alpha.0" +version = "2.3.0" authors = ["Sebastian Thiel "] edition = "2018" include = ["src/**/*", "Cargo.*"] diff --git a/src/aggregate.rs b/src/aggregate.rs index 28a3ccd..0652a03 100644 --- a/src/aggregate.rs +++ b/src/aggregate.rs @@ -30,7 +30,7 @@ pub fn aggregate( match entry { Ok(entry) => { let file_size = match entry.metadata { - Some(Ok(ref m)) if !m.is_dir() && (options.count_links || inodes.add(m)) => { + Some(Ok(ref m)) if !m.is_dir() && (options.count_hard_links || inodes.add(m)) => { if options.apparent_size { m.len() } else { diff --git a/src/common.rs b/src/common.rs index 2d5fcba..a1551b8 100644 --- a/src/common.rs +++ b/src/common.rs @@ -152,7 +152,7 @@ pub struct WalkOptions { /// for more information. pub threads: usize, pub byte_format: ByteFormat, - pub count_links: bool, + pub count_hard_links: bool, pub apparent_size: bool, pub color: Color, pub sorting: TraversalSorting, diff --git a/src/interactive/app_test/utils.rs b/src/interactive/app_test/utils.rs index d696f6c..f59fc2d 100644 --- a/src/interactive/app_test/utils.rs +++ b/src/interactive/app_test/utils.rs @@ -165,7 +165,7 @@ pub fn initialized_app_and_terminal_with_closure>( threads: 1, byte_format: ByteFormat::Metric, apparent_size: true, - count_links: false, + count_hard_links: false, color: Color::None, sorting: TraversalSorting::AlphabeticalByFileName, }, diff --git a/src/main.rs b/src/main.rs index c1643a4..22e47df 100644 --- a/src/main.rs +++ b/src/main.rs @@ -30,7 +30,7 @@ fn run() -> Result<(), Error> { Color::None }, apparent_size: opt.apparent_size, - count_links: opt.count_links, + count_hard_links: opt.count_hard_links, sorting: TraversalSorting::None, }; let res = match opt.command { diff --git a/src/options.rs b/src/options.rs index e3e44a2..1a06e45 100644 --- a/src/options.rs +++ b/src/options.rs @@ -49,16 +49,16 @@ pub struct Args { /// GiB - only gibibytes /// MB - only megabytes /// MiB - only mebibytes - #[structopt(short = "f", long = "format")] + #[structopt(short = "f", long)] pub format: Option, /// Display apparent size instead of disk usage. - #[structopt(short = "A", long = "apparent-size")] + #[structopt(short = "A", long)] pub apparent_size: bool, /// Count hard-linked files each time they are seen - #[structopt(short = "l", long = "count-links")] - pub count_links: bool, + #[structopt(short = "l", long)] + pub count_hard_links: bool, /// One or more input files or directories. If unset, we will use all entries in the current working directory. #[structopt(parse(from_os_str))] @@ -82,10 +82,10 @@ pub enum Command { statistics: bool, /// If set, paths will be printed in their order of occurrence on the command-line. /// Otherwise they are sorted by their size in bytes, ascending. - #[structopt(long = "no-sort")] + #[structopt(long)] no_sort: bool, /// If set, no total column will be computed for multiple inputs - #[structopt(long = "no-total")] + #[structopt(long)] no_total: bool, /// One or more input files or directories. If unset, we will use all entries in the current working directory. #[structopt(parse(from_os_str))] diff --git a/src/traverse.rs b/src/traverse.rs index 13b1623..a65595e 100644 --- a/src/traverse.rs +++ b/src/traverse.rs @@ -94,7 +94,7 @@ impl Traversal { entry.file_name }; let file_size = match entry.metadata { - Some(Ok(ref m)) if !m.is_dir() && (walk_options.count_links || inodes.add(m)) => { + Some(Ok(ref m)) if !m.is_dir() && (walk_options.count_hard_links || inodes.add(m)) => { if walk_options.apparent_size { m.len() } else { -- cgit v1.2.3