Skip to content

Commit

Permalink
Rename 'human*' formats to their non-prefixed counterpart
Browse files Browse the repository at this point in the history
This makes more sense, and is more comfortable.
  • Loading branch information
Sebastian Thiel committed Jun 4, 2019
1 parent a5c8e37 commit d13adea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ use structopt::{clap::arg_enum, StructOpt};
arg_enum! {
#[derive(PartialEq, Debug)]
pub enum ByteFormat {
HumanMetric,
HumanBinary,
Metric,
Binary,
Bytes
}
}

impl From<ByteFormat> for LibraryByteFormat {
fn from(input: ByteFormat) -> Self {
match input {
ByteFormat::HumanMetric => LibraryByteFormat::Metric,
ByteFormat::HumanBinary => LibraryByteFormat::Binary,
ByteFormat::Metric => LibraryByteFormat::Metric,
ByteFormat::Binary => LibraryByteFormat::Binary,
ByteFormat::Bytes => LibraryByteFormat::Bytes,
}
}
Expand All @@ -34,8 +34,8 @@ pub struct Args {
pub threads: Option<usize>,

/// The format with which to print byte counts.
/// HumanMetric - uses 1000 as base (default)
/// HumanBinary - uses 1024 as base
/// Metric - uses 1000 as base (default)
/// Binary - uses 1024 as base
/// Bytes - plain bytes without any formatting
#[structopt(short = "f", long = "format")]
pub format: Option<ByteFormat>,
Expand Down
2 changes: 1 addition & 1 deletion tests/stateless-journey.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ WITH_FAILURE=1
(with "human-binary"
it "produces a human-readable aggregate of the current directory, without total" && {
WITH_SNAPSHOT="$snapshot/success-bytes-binary" \
expect_run ${SUCCESSFULLY} "$exe" --format humanbinary
expect_run ${SUCCESSFULLY} "$exe" --format binary
}
)
(with "bytes"
Expand Down

0 comments on commit d13adea

Please sign in to comment.