Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/bashkit/src/builtins/generated/cat_args.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// GENERATED by bashkit-coreutils-port. DO NOT EDIT.
//
// Source: uutils/coreutils@d2d96946b src/uu/cat/
// Source: uutils/coreutils@afe06319a src/uu/cat/
// Regenerate: cargo run -p bashkit-coreutils-port -- <UUTILS_DIR> cat <REV>
//
// Original uutils licensed MIT; see THIRD_PARTY_LICENSES.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// GENERATED by bashkit-coreutils-port. DO NOT EDIT.
//
// Source: uutils/coreutils@d2d96946b src/uucore/src/lib/features/extendedbigdecimal.rs
// Source: uutils/coreutils@afe06319a src/uucore/src/lib/features/extendedbigdecimal.rs
// Regenerate: cargo run -p bashkit-coreutils-port -- port-module <UUTILS_DIR> format <REV>
//
// Original uutils licensed MIT; see THIRD_PARTY_LICENSES.
Expand Down
2 changes: 1 addition & 1 deletion crates/bashkit/src/builtins/generated/format/argument.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// GENERATED by bashkit-coreutils-port. DO NOT EDIT.
//
// Source: uutils/coreutils@d2d96946b src/uucore/src/lib/features/format/argument.rs
// Source: uutils/coreutils@afe06319a src/uucore/src/lib/features/format/argument.rs
// Regenerate: cargo run -p bashkit-coreutils-port -- port-module <UUTILS_DIR> format <REV>
//
// Original uutils licensed MIT; see THIRD_PARTY_LICENSES.
Expand Down
2 changes: 1 addition & 1 deletion crates/bashkit/src/builtins/generated/format/escape.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// GENERATED by bashkit-coreutils-port. DO NOT EDIT.
//
// Source: uutils/coreutils@d2d96946b src/uucore/src/lib/features/format/escape.rs
// Source: uutils/coreutils@afe06319a src/uucore/src/lib/features/format/escape.rs
// Regenerate: cargo run -p bashkit-coreutils-port -- port-module <UUTILS_DIR> format <REV>
//
// Original uutils licensed MIT; see THIRD_PARTY_LICENSES.
Expand Down
2 changes: 1 addition & 1 deletion crates/bashkit/src/builtins/generated/format/human.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// GENERATED by bashkit-coreutils-port. DO NOT EDIT.
//
// Source: uutils/coreutils@d2d96946b src/uucore/src/lib/features/format/human.rs
// Source: uutils/coreutils@afe06319a src/uucore/src/lib/features/format/human.rs
// Regenerate: cargo run -p bashkit-coreutils-port -- port-module <UUTILS_DIR> format <REV>
//
// Original uutils licensed MIT; see THIRD_PARTY_LICENSES.
Expand Down
2 changes: 1 addition & 1 deletion crates/bashkit/src/builtins/generated/format/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// GENERATED by bashkit-coreutils-port. DO NOT EDIT.
//
// Source: uutils/coreutils@d2d96946b src/uucore/src/lib/features/format/mod.rs
// Source: uutils/coreutils@afe06319a src/uucore/src/lib/features/format/mod.rs
// Regenerate: cargo run -p bashkit-coreutils-port -- port-module <UUTILS_DIR> format <REV>
//
// Original uutils licensed MIT; see THIRD_PARTY_LICENSES.
Expand Down
2 changes: 1 addition & 1 deletion crates/bashkit/src/builtins/generated/format/num_format.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// GENERATED by bashkit-coreutils-port. DO NOT EDIT.
//
// Source: uutils/coreutils@d2d96946b src/uucore/src/lib/features/format/num_format.rs
// Source: uutils/coreutils@afe06319a src/uucore/src/lib/features/format/num_format.rs
// Regenerate: cargo run -p bashkit-coreutils-port -- port-module <UUTILS_DIR> format <REV>
//
// Original uutils licensed MIT; see THIRD_PARTY_LICENSES.
Expand Down
2 changes: 1 addition & 1 deletion crates/bashkit/src/builtins/generated/format/spec.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// GENERATED by bashkit-coreutils-port. DO NOT EDIT.
//
// Source: uutils/coreutils@d2d96946b src/uucore/src/lib/features/format/spec.rs
// Source: uutils/coreutils@afe06319a src/uucore/src/lib/features/format/spec.rs
// Regenerate: cargo run -p bashkit-coreutils-port -- port-module <UUTILS_DIR> format <REV>
//
// Original uutils licensed MIT; see THIRD_PARTY_LICENSES.
Expand Down
2 changes: 1 addition & 1 deletion crates/bashkit/src/builtins/generated/ls_args.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// GENERATED by bashkit-coreutils-port. DO NOT EDIT.
//
// Source: uutils/coreutils@d2d96946b src/uu/ls/
// Source: uutils/coreutils@afe06319a src/uu/ls/
// Regenerate: cargo run -p bashkit-coreutils-port -- <UUTILS_DIR> ls <REV>
//
// Original uutils licensed MIT; see THIRD_PARTY_LICENSES.
Expand Down
2 changes: 1 addition & 1 deletion crates/bashkit/src/builtins/generated/mktemp_args.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// GENERATED by bashkit-coreutils-port. DO NOT EDIT.
//
// Source: uutils/coreutils@d2d96946b src/uu/mktemp/
// Source: uutils/coreutils@afe06319a src/uu/mktemp/
// Regenerate: cargo run -p bashkit-coreutils-port -- <UUTILS_DIR> mktemp <REV>
//
// Original uutils licensed MIT; see THIRD_PARTY_LICENSES.
Expand Down
2 changes: 1 addition & 1 deletion crates/bashkit/src/builtins/generated/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
// and at test time (the invariant assertion). Nothing in the lib's
// runtime path needs it, hence `allow(dead_code)`.
#[allow(dead_code)]
pub const UUTILS_REVISION: &str = "d2d96946b";
pub const UUTILS_REVISION: &str = "afe06319a";

pub mod cat_args;
#[allow(clippy::collapsible_if, clippy::unwrap_used)]
Expand Down
16 changes: 13 additions & 3 deletions crates/bashkit/src/builtins/generated/num_parser.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// GENERATED by bashkit-coreutils-port. DO NOT EDIT.
//
// Source: uutils/coreutils@d2d96946b src/uucore/src/lib/features/parser/num_parser.rs
// Source: uutils/coreutils@afe06319a src/uucore/src/lib/features/parser/num_parser.rs
// Regenerate: cargo run -p bashkit-coreutils-port -- port-module <UUTILS_DIR> format <REV>
//
// Original uutils licensed MIT; see THIRD_PARTY_LICENSES.
Expand All @@ -14,6 +14,7 @@ use bigdecimal::num_bigint::Sign;
use num_traits::Signed;
use num_traits::ToPrimitive;
use num_traits::Zero;
const SUBNANOSECOND_BINARY_EXPONENT: i32 = -30;
#[derive(Clone, Copy, PartialEq)]
enum Base {
/// Binary base
Expand Down Expand Up @@ -423,8 +424,17 @@ pub(crate) fn parse(
}
let (mul, rest) = parse_suffix_multiplier(rest, allowed_suffixes);
let digits = digits.unwrap() * mul;
let ebd_result =
construct_extended_big_decimal(digits, negative, base, scale, exponent.unwrap_or_default());
let exponent = exponent.unwrap_or_default();
let ebd_result = if target == ParseTarget::Duration
&& base == Base::Hexadecimal
&& !digits.is_zero()
&& BigInt::from(digits.bits()) + &exponent - BigInt::from(scale) * 4
<= BigInt::from(SUBNANOSECOND_BINARY_EXPONENT)
{
Err(make_error(false, negative))
} else {
construct_extended_big_decimal(digits, negative, base, scale, exponent)
};
if rest.is_empty() {
ebd_result
} else {
Expand Down
2 changes: 1 addition & 1 deletion crates/bashkit/src/builtins/generated/od_args.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// GENERATED by bashkit-coreutils-port. DO NOT EDIT.
//
// Source: uutils/coreutils@d2d96946b src/uu/od/
// Source: uutils/coreutils@afe06319a src/uu/od/
// Regenerate: cargo run -p bashkit-coreutils-port -- <UUTILS_DIR> od <REV>
//
// Original uutils licensed MIT; see THIRD_PARTY_LICENSES.
Expand Down
2 changes: 1 addition & 1 deletion crates/bashkit/src/builtins/generated/readlink_args.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// GENERATED by bashkit-coreutils-port. DO NOT EDIT.
//
// Source: uutils/coreutils@d2d96946b src/uu/readlink/
// Source: uutils/coreutils@afe06319a src/uu/readlink/
// Regenerate: cargo run -p bashkit-coreutils-port -- <UUTILS_DIR> readlink <REV>
//
// Original uutils licensed MIT; see THIRD_PARTY_LICENSES.
Expand Down
2 changes: 1 addition & 1 deletion crates/bashkit/src/builtins/generated/realpath_args.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// GENERATED by bashkit-coreutils-port. DO NOT EDIT.
//
// Source: uutils/coreutils@d2d96946b src/uu/realpath/
// Source: uutils/coreutils@afe06319a src/uu/realpath/
// Regenerate: cargo run -p bashkit-coreutils-port -- <UUTILS_DIR> realpath <REV>
//
// Original uutils licensed MIT; see THIRD_PARTY_LICENSES.
Expand Down
16 changes: 1 addition & 15 deletions crates/bashkit/src/builtins/generated/shuf_args.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// GENERATED by bashkit-coreutils-port. DO NOT EDIT.
//
// Source: uutils/coreutils@d2d96946b src/uu/shuf/
// Source: uutils/coreutils@afe06319a src/uu/shuf/
// Regenerate: cargo run -p bashkit-coreutils-port -- <UUTILS_DIR> shuf <REV>
//
// Original uutils licensed MIT; see THIRD_PARTY_LICENSES.
Expand Down Expand Up @@ -42,19 +42,6 @@ fn format_usage(s: &str) -> String {
/// virtual `ctx.env` — never `std::env` — drives clap's env-default
/// path. Order matches the chain order in the original `uu_app()`.
pub static SHUF_ENV_DEFAULTS: &[crate::builtins::clap_env::EnvDefault] = &[];
fn parse_range(input_range: &str) -> Result<RangeInclusive<u64>, String> {
if let Some((from, to)) = input_range.split_once('-') {
let begin = from.parse::<u64>().map_err(|e| e.to_string())?;
let end = to.parse::<u64>().map_err(|e| e.to_string())?;
if begin <= end || begin == end + 1 {
Ok(begin..=end)
} else {
Err(::std::string::String::from("start exceeds end"))
}
} else {
Err(::std::string::String::from("missing '-'"))
}
}
pub fn shuf_command() -> Command {
Command::new("shuf")
.about(
Expand Down Expand Up @@ -90,7 +77,6 @@ pub fn shuf_command() -> Command {
"treat each number LO through HI as an input line",
),
)
.value_parser(parse_range)
.conflicts_with(options::FILE_OR_ARGS),
)
.arg(
Expand Down
2 changes: 1 addition & 1 deletion crates/bashkit/src/builtins/generated/stat_args.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// GENERATED by bashkit-coreutils-port. DO NOT EDIT.
//
// Source: uutils/coreutils@d2d96946b src/uu/stat/
// Source: uutils/coreutils@afe06319a src/uu/stat/
// Regenerate: cargo run -p bashkit-coreutils-port -- <UUTILS_DIR> stat <REV>
//
// Original uutils licensed MIT; see THIRD_PARTY_LICENSES.
Expand Down
2 changes: 1 addition & 1 deletion crates/bashkit/src/builtins/generated/tac_args.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// GENERATED by bashkit-coreutils-port. DO NOT EDIT.
//
// Source: uutils/coreutils@d2d96946b src/uu/tac/
// Source: uutils/coreutils@afe06319a src/uu/tac/
// Regenerate: cargo run -p bashkit-coreutils-port -- <UUTILS_DIR> tac <REV>
//
// Original uutils licensed MIT; see THIRD_PARTY_LICENSES.
Expand Down
2 changes: 1 addition & 1 deletion crates/bashkit/src/builtins/generated/tee_args.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// GENERATED by bashkit-coreutils-port. DO NOT EDIT.
//
// Source: uutils/coreutils@d2d96946b src/uu/tee/
// Source: uutils/coreutils@afe06319a src/uu/tee/
// Regenerate: cargo run -p bashkit-coreutils-port -- <UUTILS_DIR> tee <REV>
//
// Original uutils licensed MIT; see THIRD_PARTY_LICENSES.
Expand Down
2 changes: 1 addition & 1 deletion crates/bashkit/src/builtins/generated/truncate_args.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// GENERATED by bashkit-coreutils-port. DO NOT EDIT.
//
// Source: uutils/coreutils@d2d96946b src/uu/truncate/
// Source: uutils/coreutils@afe06319a src/uu/truncate/
// Regenerate: cargo run -p bashkit-coreutils-port -- <UUTILS_DIR> truncate <REV>
//
// Original uutils licensed MIT; see THIRD_PARTY_LICENSES.
Expand Down
Loading