summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSebastian Thiel <sebastian.thiel@icloud.com>2020-02-22 13:48:16 +0800
committerSebastian Thiel <sebastian.thiel@icloud.com>2020-02-22 13:48:16 +0800
commitdb514fe58c234ad312156814ba6f5ee7b7af0b60 (patch)
tree68b049fd8667d36c88459d465310d26e1ea4dcf9 /src
parenta6a4cf3705ba764ca0862fd3faaf0f7df31ac28d (diff)
Rename 'count-links' to more descriptive 'count-hard-links'
Diffstat (limited to 'src')
-rw-r--r--src/aggregate.rs2
-rw-r--r--src/common.rs2
-rw-r--r--src/interactive/app_test/utils.rs2
-rw-r--r--src/main.rs2
-rw-r--r--src/options.rs12
-rw-r--r--src/traverse.rs2
6 files changed, 11 insertions, 11 deletions
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<P: AsRef<Path>>(
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<ByteFormat>,
/// 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 {