Skip to content

Commit ca5c72b

Browse files
committed
feat(cli): set some value aliases
1 parent 18f5d7b commit ca5c72b

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

src/args/quantity.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@ use clap::ValueEnum;
66
#[cfg_attr(feature = "cli", derive(ValueEnum))]
77
pub enum Quantity {
88
/// Measure apparent sizes.
9+
#[cfg_attr(feature = "cli", clap(alias = "len"))]
910
ApparentSize,
1011
/// Measure block sizes (block-count * 512B).
1112
#[cfg(unix)]
13+
#[cfg_attr(feature = "cli", clap(alias = "blksize"))]
1214
BlockSize,
1315
/// Count numbers of blocks.
1416
#[cfg(unix)]
17+
#[cfg_attr(feature = "cli", clap(alias = "blocks"))]
1518
BlockCount,
1619
}
1720

src/bytes_format.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ pub enum BytesFormat {
1919
/// Display the value as-is.
2020
#[cfg_attr(
2121
feature = "cli",
22-
clap(name = "plain", help = "Display plain number of bytes without units")
22+
clap(
23+
name = "plain",
24+
help = "Display plain number of bytes without units",
25+
alias = "1"
26+
)
2327
)]
2428
PlainNumber,
2529
/// Display the value with a unit suffix in [metric scale](formatter::METRIC).
@@ -28,6 +32,7 @@ pub enum BytesFormat {
2832
clap(
2933
name = "metric",
3034
help = "Use metric scale, i.e. 1K = 1000B, 1M = 1000K, and so on",
35+
alias = "1000"
3136
)
3237
)]
3338
MetricUnits,
@@ -37,6 +42,7 @@ pub enum BytesFormat {
3742
clap(
3843
name = "binary",
3944
help = "Use binary scale, i.e. 1K = 1024B, 1M = 1024K, and so on",
45+
alias = "1024"
4046
)
4147
)]
4248
BinaryUnits,

0 commit comments

Comments
 (0)