mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
Merge pull request #3338 from cakebaker/rename_human_readable_constants
df: rename two constants
This commit is contained in:
commit
de71d01959
2 changed files with 9 additions and 9 deletions
|
@ -3,7 +3,7 @@
|
||||||
// * For the full copyright and license information, please view the LICENSE
|
// * For the full copyright and license information, please view the LICENSE
|
||||||
// * file that was distributed with this source code.
|
// * file that was distributed with this source code.
|
||||||
//! Types for representing and displaying block sizes.
|
//! 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 clap::ArgMatches;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::num::ParseIntError;
|
use std::num::ParseIntError;
|
||||||
|
@ -108,9 +108,9 @@ impl Default for BlockSize {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn block_size_from_matches(matches: &ArgMatches) -> Result<BlockSize, ParseIntError> {
|
pub(crate) fn block_size_from_matches(matches: &ArgMatches) -> Result<BlockSize, ParseIntError> {
|
||||||
if matches.is_present(OPT_HUMAN_READABLE) {
|
if matches.is_present(OPT_HUMAN_READABLE_BINARY) {
|
||||||
Ok(BlockSize::HumanReadableBinary)
|
Ok(BlockSize::HumanReadableBinary)
|
||||||
} else if matches.is_present(OPT_HUMAN_READABLE_2) {
|
} else if matches.is_present(OPT_HUMAN_READABLE_DECIMAL) {
|
||||||
Ok(BlockSize::HumanReadableDecimal)
|
Ok(BlockSize::HumanReadableDecimal)
|
||||||
} else if matches.is_present(OPT_BLOCKSIZE) {
|
} else if matches.is_present(OPT_BLOCKSIZE) {
|
||||||
let s = matches.value_of(OPT_BLOCKSIZE).unwrap();
|
let s = matches.value_of(OPT_BLOCKSIZE).unwrap();
|
||||||
|
|
|
@ -35,8 +35,8 @@ static OPT_HELP: &str = "help";
|
||||||
static OPT_ALL: &str = "all";
|
static OPT_ALL: &str = "all";
|
||||||
static OPT_BLOCKSIZE: &str = "blocksize";
|
static OPT_BLOCKSIZE: &str = "blocksize";
|
||||||
static OPT_TOTAL: &str = "total";
|
static OPT_TOTAL: &str = "total";
|
||||||
static OPT_HUMAN_READABLE: &str = "human-readable";
|
static OPT_HUMAN_READABLE_BINARY: &str = "human-readable-binary";
|
||||||
static OPT_HUMAN_READABLE_2: &str = "human-readable-2";
|
static OPT_HUMAN_READABLE_DECIMAL: &str = "human-readable-decimal";
|
||||||
static OPT_INODES: &str = "inodes";
|
static OPT_INODES: &str = "inodes";
|
||||||
static OPT_KILO: &str = "kilo";
|
static OPT_KILO: &str = "kilo";
|
||||||
static OPT_LOCAL: &str = "local";
|
static OPT_LOCAL: &str = "local";
|
||||||
|
@ -385,17 +385,17 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.help("produce a grand total"),
|
.help("produce a grand total"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(OPT_HUMAN_READABLE)
|
Arg::new(OPT_HUMAN_READABLE_BINARY)
|
||||||
.short('h')
|
.short('h')
|
||||||
.long("human-readable")
|
.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)"),
|
.help("print sizes in human readable format (e.g., 1K 234M 2G)"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(OPT_HUMAN_READABLE_2)
|
Arg::new(OPT_HUMAN_READABLE_DECIMAL)
|
||||||
.short('H')
|
.short('H')
|
||||||
.long("si")
|
.long("si")
|
||||||
.conflicts_with(OPT_HUMAN_READABLE)
|
.conflicts_with(OPT_HUMAN_READABLE_BINARY)
|
||||||
.help("likewise, but use powers of 1000 not 1024"),
|
.help("likewise, but use powers of 1000 not 1024"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue