From b9ac38084ce4b477cf0ef1cb77010f43a9ef9c85 Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Wed, 30 Mar 2022 16:47:08 +0200 Subject: [PATCH] df: rename two constants OPT_HUMAN_READABLE -> OPT_HUMAN_READABLE_BINARY OPT_HUMAN_READABLE_2 -> OPT_HUMAN_READABLE_DECIMAL --- src/uu/df/src/blocks.rs | 6 +++--- src/uu/df/src/df.rs | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/uu/df/src/blocks.rs b/src/uu/df/src/blocks.rs index 10ec22012..0943c9447 100644 --- a/src/uu/df/src/blocks.rs +++ b/src/uu/df/src/blocks.rs @@ -3,7 +3,7 @@ // * For the full copyright and license information, please view the LICENSE // * file that was distributed with this source code. //! Types for representing and displaying block sizes. -use crate::{OPT_BLOCKSIZE, OPT_HUMAN_READABLE, OPT_HUMAN_READABLE_2}; +use crate::{OPT_BLOCKSIZE, OPT_HUMAN_READABLE_BINARY, OPT_HUMAN_READABLE_DECIMAL}; use clap::ArgMatches; use std::fmt; use std::num::ParseIntError; @@ -108,9 +108,9 @@ impl Default for BlockSize { } pub(crate) fn block_size_from_matches(matches: &ArgMatches) -> Result { - if matches.is_present(OPT_HUMAN_READABLE) { + if matches.is_present(OPT_HUMAN_READABLE_BINARY) { Ok(BlockSize::HumanReadableBinary) - } else if matches.is_present(OPT_HUMAN_READABLE_2) { + } else if matches.is_present(OPT_HUMAN_READABLE_DECIMAL) { Ok(BlockSize::HumanReadableDecimal) } else if matches.is_present(OPT_BLOCKSIZE) { let s = matches.value_of(OPT_BLOCKSIZE).unwrap(); diff --git a/src/uu/df/src/df.rs b/src/uu/df/src/df.rs index 5e130a8f7..d125e73d0 100644 --- a/src/uu/df/src/df.rs +++ b/src/uu/df/src/df.rs @@ -35,8 +35,8 @@ static OPT_HELP: &str = "help"; static OPT_ALL: &str = "all"; static OPT_BLOCKSIZE: &str = "blocksize"; static OPT_TOTAL: &str = "total"; -static OPT_HUMAN_READABLE: &str = "human-readable"; -static OPT_HUMAN_READABLE_2: &str = "human-readable-2"; +static OPT_HUMAN_READABLE_BINARY: &str = "human-readable-binary"; +static OPT_HUMAN_READABLE_DECIMAL: &str = "human-readable-decimal"; static OPT_INODES: &str = "inodes"; static OPT_KILO: &str = "kilo"; static OPT_LOCAL: &str = "local"; @@ -385,17 +385,17 @@ pub fn uu_app<'a>() -> Command<'a> { .help("produce a grand total"), ) .arg( - Arg::new(OPT_HUMAN_READABLE) + Arg::new(OPT_HUMAN_READABLE_BINARY) .short('h') .long("human-readable") - .conflicts_with(OPT_HUMAN_READABLE_2) + .conflicts_with(OPT_HUMAN_READABLE_DECIMAL) .help("print sizes in human readable format (e.g., 1K 234M 2G)"), ) .arg( - Arg::new(OPT_HUMAN_READABLE_2) + Arg::new(OPT_HUMAN_READABLE_DECIMAL) .short('H') .long("si") - .conflicts_with(OPT_HUMAN_READABLE) + .conflicts_with(OPT_HUMAN_READABLE_BINARY) .help("likewise, but use powers of 1000 not 1024"), ) .arg(