Skip to content

Commit 7503a1d

Browse files
committed
cli: help: Correct the help messages of ValueEnum
1 parent e39d71f commit 7503a1d

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

src/args/quantity.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,19 @@ use clap::ValueEnum;
77
pub enum Quantity {
88
/// Measure apparent sizes, equivalent to the
99
/// [len](std::fs::Metadata::len) method.
10-
#[cfg_attr(feature = "cli", clap(name = "len"))]
10+
#[cfg_attr(feature = "cli", clap(name = "len", help = "Measure apparent sizes"))]
1111
ApparentSize,
1212
/// Measure block sizes, equivalent to the
1313
/// [blksize](std::os::unix::prelude::MetadataExt::blksize) method (POSIX only).
1414
#[cfg(unix)]
15-
#[cfg_attr(feature = "cli", clap(name = "blksize"))]
15+
#[cfg_attr(feature = "cli", clap(name = "blksize", help = "Measure blksize"))]
1616
BlockSize,
1717
/// Count numbers of blocks, equivalent to the
1818
/// [blocks](std::os::unix::prelude::MetadataExt::blocks) method (POSIX only).
1919
#[cfg(unix)]
20-
#[cfg_attr(feature = "cli", clap(name = "blocks"))]
20+
#[cfg_attr(
21+
feature = "cli",
22+
clap(name = "blocks", help = "Count number of blocks")
23+
)]
2124
BlockCount,
2225
}

src/bytes_format.rs

+18-3
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,28 @@ use clap::ValueEnum;
1717
#[cfg_attr(feature = "cli", derive(ValueEnum))]
1818
pub enum BytesFormat {
1919
/// Display the value as-is.
20-
#[cfg_attr(feature = "cli", clap(name = "plain"))]
20+
#[cfg_attr(
21+
feature = "cli",
22+
clap(name = "plain", help = "Display plain number of bytes without units")
23+
)]
2124
PlainNumber,
2225
/// Display the value with a unit suffix in [metric scale](formatter::METRIC).
23-
#[cfg_attr(feature = "cli", clap(name = "metric"))]
26+
#[cfg_attr(
27+
feature = "cli",
28+
clap(
29+
name = "metric",
30+
help = "Use metric scale, i.e. 1K = 1000B, 1M = 1000K, and so on",
31+
)
32+
)]
2433
MetricUnits,
2534
/// Display the value with a unit suffix in [binary scale](formatter::BINARY).
26-
#[cfg_attr(feature = "cli", clap(name = "binary"))]
35+
#[cfg_attr(
36+
feature = "cli",
37+
clap(
38+
name = "binary",
39+
help = "Use binary scale, i.e. 1K = 1024B, 1M = 1024K, and so on",
40+
)
41+
)]
2742
BinaryUnits,
2843
}
2944

0 commit comments

Comments
 (0)