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 fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ tempfile = "3.15.0"
rand = { version = "0.9.0", features = ["small_rng"] }
similar = "2.5.0"

uucore = { path = "../src/uucore/" }
uucore = { path = "../src/uucore/", features = ["parser"] }
uu_date = { path = "../src/uu/date/" }
uu_test = { path = "../src/uu/test/" }
uu_expr = { path = "../src/uu/expr/" }
Expand Down
2 changes: 1 addition & 1 deletion fuzz/fuzz_targets/fuzz_parse_glob.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![no_main]

use libfuzzer_sys::fuzz_target;
use uucore::parse_glob;
use uucore::parser::parse_glob;

fuzz_target!(|data: &[u8]| {
if let Ok(s) = std::str::from_utf8(data) {
Expand Down
2 changes: 1 addition & 1 deletion fuzz/fuzz_targets/fuzz_parse_size.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![no_main]

use libfuzzer_sys::fuzz_target;
use uucore::parse_size::parse_size_u64;
use uucore::parser::parse_size::parse_size_u64;

fuzz_target!(|data: &[u8]| {
if let Ok(s) = std::str::from_utf8(data) {
Expand Down
2 changes: 1 addition & 1 deletion fuzz/fuzz_targets/fuzz_parse_time.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![no_main]

use libfuzzer_sys::fuzz_target;
use uucore::parse_time;
use uucore::parser::parse_time;

fuzz_target!(|data: &[u8]| {
if let Ok(s) = std::str::from_utf8(data) {
Expand Down
1 change: 1 addition & 0 deletions src/uu/cp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ uucore = { workspace = true, features = [
"entries",
"fs",
"fsxattr",
"parser",
"perms",
"mode",
"update-control",
Expand Down
4 changes: 2 additions & 2 deletions src/uu/cp/src/cp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ use uucore::{backup_control, update_control};
// requires these enum.
pub use uucore::{backup_control::BackupMode, update_control::UpdateMode};
use uucore::{
format_usage, help_about, help_section, help_usage, prompt_yes,
shortcut_value_parser::ShortcutValueParser, show_error, show_warning,
format_usage, help_about, help_section, help_usage,
parser::shortcut_value_parser::ShortcutValueParser, prompt_yes, show_error, show_warning,
};

use crate::copydir::copy_directory;
Expand Down
2 changes: 1 addition & 1 deletion src/uu/date/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ path = "src/date.rs"
[dependencies]
chrono = { workspace = true }
clap = { workspace = true }
uucore = { workspace = true, features = ["custom-tz-fmt"] }
uucore = { workspace = true, features = ["custom-tz-fmt", "parser"] }
parse_datetime = { workspace = true }

[target.'cfg(unix)'.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion src/uu/date/src/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use uucore::{format_usage, help_about, help_usage, show};
#[cfg(windows)]
use windows_sys::Win32::{Foundation::SYSTEMTIME, System::SystemInformation::SetSystemTime};

use uucore::shortcut_value_parser::ShortcutValueParser;
use uucore::parser::shortcut_value_parser::ShortcutValueParser;

// Options
const DATE: &str = "date";
Expand Down
2 changes: 1 addition & 1 deletion src/uu/dd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ path = "src/dd.rs"
clap = { workspace = true }
gcd = { workspace = true }
libc = { workspace = true }
uucore = { workspace = true, features = ["format", "quoting-style"] }
uucore = { workspace = true, features = ["format", "parser", "quoting-style"] }
thiserror = { workspace = true }

[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion src/uu/dd/src/parseargs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::conversion_tables::ConversionTable;
use thiserror::Error;
use uucore::display::Quotable;
use uucore::error::UError;
use uucore::parse_size::{ParseSizeError, Parser as SizeParser};
use uucore::parser::parse_size::{ParseSizeError, Parser as SizeParser};
use uucore::show_warning;

/// Parser Errors describe errors with parser input
Expand Down
2 changes: 1 addition & 1 deletion src/uu/df/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ path = "src/df.rs"

[dependencies]
clap = { workspace = true }
uucore = { workspace = true, features = ["libc", "fsext"] }
uucore = { workspace = true, features = ["libc", "fsext", "parser"] }
unicode-width = { workspace = true }
thiserror = { workspace = true }

Expand Down
2 changes: 1 addition & 1 deletion src/uu/df/src/blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::{env, fmt};

use uucore::{
display::Quotable,
parse_size::{ParseSizeError, parse_size_u64},
parser::parse_size::{ParseSizeError, parse_size_u64},
};

/// The first ten powers of 1024.
Expand Down
2 changes: 1 addition & 1 deletion src/uu/df/src/df.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use table::HeaderMode;
use uucore::display::Quotable;
use uucore::error::{UError, UResult, USimpleError};
use uucore::fsext::{MountInfo, read_fs_list};
use uucore::parse_size::ParseSizeError;
use uucore::parser::parse_size::ParseSizeError;
use uucore::{format_usage, help_about, help_section, help_usage, show};

use clap::{Arg, ArgAction, ArgMatches, Command, parser::ValueSource};
Expand Down
2 changes: 1 addition & 1 deletion src/uu/dircolors/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ path = "src/dircolors.rs"

[dependencies]
clap = { workspace = true }
uucore = { workspace = true, features = ["colors"] }
uucore = { workspace = true, features = ["colors", "parser"] }

[[bin]]
name = "dircolors"
Expand Down
2 changes: 1 addition & 1 deletion src/uu/dircolors/src/dircolors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use clap::{Arg, ArgAction, Command};
use uucore::colors::{FILE_ATTRIBUTE_CODES, FILE_COLORS, FILE_TYPES, TERMS};
use uucore::display::Quotable;
use uucore::error::{UResult, USimpleError, UUsageError};
use uucore::{format_usage, help_about, help_section, help_usage, parse_glob};
use uucore::{format_usage, help_about, help_section, help_usage, parser::parse_glob};

mod options {
pub const BOURNE_SHELL: &str = "bourne-shell";
Expand Down
2 changes: 1 addition & 1 deletion src/uu/du/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ chrono = { workspace = true }
# For the --exclude & --exclude-from options
glob = { workspace = true }
clap = { workspace = true }
uucore = { workspace = true, features = ["format"] }
uucore = { workspace = true, features = ["format", "parser"] }
thiserror = { workspace = true }

[target.'cfg(target_os = "windows")'.dependencies]
Expand Down
6 changes: 3 additions & 3 deletions src/uu/du/src/du.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ use thiserror::Error;
use uucore::display::{Quotable, print_verbatim};
use uucore::error::{FromIo, UError, UResult, USimpleError, set_exit_code};
use uucore::line_ending::LineEnding;
use uucore::parse_glob;
use uucore::parse_size::{ParseSizeError, parse_size_u64};
use uucore::shortcut_value_parser::ShortcutValueParser;
use uucore::parser::parse_glob;
use uucore::parser::parse_size::{ParseSizeError, parse_size_u64};
use uucore::parser::shortcut_value_parser::ShortcutValueParser;
use uucore::{format_usage, help_about, help_section, help_usage, show, show_error, show_warning};
#[cfg(windows)]
use windows_sys::Win32::Foundation::HANDLE;
Expand Down
7 changes: 6 additions & 1 deletion src/uu/head/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ path = "src/head.rs"
clap = { workspace = true }
memchr = { workspace = true }
thiserror = { workspace = true }
uucore = { workspace = true, features = ["ringbuffer", "lines", "fs"] }
uucore = { workspace = true, features = [
"parser",
"ringbuffer",
"lines",
"fs",
] }

[[bin]]
name = "head"
Expand Down
2 changes: 1 addition & 1 deletion src/uu/head/src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// file that was distributed with this source code.

use std::ffi::OsString;
use uucore::parse_size::{ParseSizeError, parse_size_u64};
use uucore::parser::parse_size::{ParseSizeError, parse_size_u64};

#[derive(PartialEq, Eq, Debug)]
pub enum ParseError {
Expand Down
1 change: 1 addition & 0 deletions src/uu/ls/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ uucore = { workspace = true, features = [
"format",
"fs",
"fsxattr",
"parser",
"quoting-style",
"version-cmp",
] }
Expand Down
8 changes: 5 additions & 3 deletions src/uu/ls/src/ls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,13 @@ use uucore::{
format_usage,
fs::display_permissions,
os_str_as_bytes_lossy,
parse_size::parse_size_u64,
shortcut_value_parser::ShortcutValueParser,
parser::parse_size::parse_size_u64,
parser::shortcut_value_parser::ShortcutValueParser,
version_cmp::version_cmp,
};
use uucore::{help_about, help_section, help_usage, parse_glob, show, show_error, show_warning};
use uucore::{
help_about, help_section, help_usage, parser::parse_glob, show, show_error, show_warning,
};

mod dired;
use dired::{DiredOutput, is_dired_arg_present};
Expand Down
2 changes: 1 addition & 1 deletion src/uu/numfmt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ path = "src/numfmt.rs"

[dependencies]
clap = { workspace = true }
uucore = { workspace = true, features = ["ranges"] }
uucore = { workspace = true, features = ["parser", "ranges"] }
thiserror = { workspace = true }

[[bin]]
Expand Down
2 changes: 1 addition & 1 deletion src/uu/numfmt/src/numfmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ use std::str::FromStr;
use units::{IEC_BASES, SI_BASES};
use uucore::display::Quotable;
use uucore::error::UResult;
use uucore::parser::shortcut_value_parser::ShortcutValueParser;
use uucore::ranges::Range;
use uucore::shortcut_value_parser::ShortcutValueParser;
use uucore::{format_usage, help_about, help_section, help_usage, show, show_error};

pub mod errors;
Expand Down
2 changes: 1 addition & 1 deletion src/uu/od/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ path = "src/od.rs"
byteorder = { workspace = true }
clap = { workspace = true }
half = { workspace = true }
uucore = { workspace = true }
uucore = { workspace = true, features = ["parser"] }

[[bin]]
name = "od"
Expand Down
4 changes: 2 additions & 2 deletions src/uu/od/src/od.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ use clap::ArgAction;
use clap::{Arg, ArgMatches, Command, parser::ValueSource};
use uucore::display::Quotable;
use uucore::error::{UResult, USimpleError};
use uucore::parse_size::ParseSizeError;
use uucore::shortcut_value_parser::ShortcutValueParser;
use uucore::parser::parse_size::ParseSizeError;
use uucore::parser::shortcut_value_parser::ShortcutValueParser;
use uucore::{format_usage, help_about, help_section, help_usage, show_error, show_warning};

const PEEK_BUFFER_SIZE: usize = 4; // utf-8 can be 4 bytes
Expand Down
2 changes: 1 addition & 1 deletion src/uu/od/src/parse_nrofbytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.
use uucore::parse_size::{ParseSizeError, parse_size_u64};
use uucore::parser::parse_size::{ParseSizeError, parse_size_u64};

pub fn parse_number_of_bytes(s: &str) -> Result<u64, ParseSizeError> {
let mut start = 0;
Expand Down
9 changes: 7 additions & 2 deletions src/uu/seq/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# spell-checker:ignore bigdecimal cfgs
# spell-checker:ignore bigdecimal cfgs extendedbigdecimal
[package]
name = "uu_seq"
version = "0.0.30"
Expand All @@ -23,7 +23,12 @@ clap = { workspace = true }
num-bigint = { workspace = true }
num-traits = { workspace = true }
thiserror = { workspace = true }
uucore = { workspace = true, features = ["format", "quoting-style"] }
uucore = { workspace = true, features = [
"extendedbigdecimal",
"format",
"parser",
"quoting-style",
] }

[[bin]]
name = "seq"
Expand Down
2 changes: 1 addition & 1 deletion src/uu/seq/src/number.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// spell-checker:ignore extendedbigdecimal
use num_traits::Zero;

use uucore::format::ExtendedBigDecimal;
use uucore::extendedbigdecimal::ExtendedBigDecimal;

/// A number with a specified number of integer and fractional digits.
///
Expand Down
6 changes: 3 additions & 3 deletions src/uu/seq/src/numberparse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
//! [`PreciseNumber`] struct.
use std::str::FromStr;

use uucore::format::num_parser::{ExtendedParser, ExtendedParserError};
use uucore::parser::num_parser::{ExtendedParser, ExtendedParserError};

use crate::number::PreciseNumber;
use uucore::format::ExtendedBigDecimal;
use uucore::extendedbigdecimal::ExtendedBigDecimal;

/// An error returned when parsing a number fails.
#[derive(Debug, PartialEq, Eq)]
Expand Down Expand Up @@ -126,7 +126,7 @@ impl FromStr for PreciseNumber {
#[cfg(test)]
mod tests {
use bigdecimal::BigDecimal;
use uucore::format::ExtendedBigDecimal;
use uucore::extendedbigdecimal::ExtendedBigDecimal;

use crate::number::PreciseNumber;
use crate::numberparse::ParseNumberError;
Expand Down
3 changes: 2 additions & 1 deletion src/uu/seq/src/seq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ use clap::{Arg, ArgAction, Command};
use num_traits::Zero;

use uucore::error::{FromIo, UResult};
use uucore::extendedbigdecimal::ExtendedBigDecimal;
use uucore::format::num_format::FloatVariant;
use uucore::format::{ExtendedBigDecimal, Format, num_format};
use uucore::format::{Format, num_format};
use uucore::{format_usage, help_about, help_usage};

mod error;
Expand Down
2 changes: 1 addition & 1 deletion src/uu/shred/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ path = "src/shred.rs"
[dependencies]
clap = { workspace = true }
rand = { workspace = true }
uucore = { workspace = true }
uucore = { workspace = true, features = ["parser"] }
libc = { workspace = true }

[[bin]]
Expand Down
4 changes: 2 additions & 2 deletions src/uu/shred/src/shred.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ use std::os::unix::prelude::PermissionsExt;
use std::path::{Path, PathBuf};
use uucore::display::Quotable;
use uucore::error::{FromIo, UResult, USimpleError, UUsageError};
use uucore::parse_size::parse_size_u64;
use uucore::shortcut_value_parser::ShortcutValueParser;
use uucore::parser::parse_size::parse_size_u64;
use uucore::parser::shortcut_value_parser::ShortcutValueParser;
use uucore::{format_usage, help_about, help_section, help_usage, show_error, show_if_err};

const ABOUT: &str = help_about!("shred.md");
Expand Down
2 changes: 1 addition & 1 deletion src/uu/sort/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ self_cell = { workspace = true }
tempfile = { workspace = true }
thiserror = { workspace = true }
unicode-width = { workspace = true }
uucore = { workspace = true, features = ["fs", "version-cmp"] }
uucore = { workspace = true, features = ["fs", "parser", "version-cmp"] }

[target.'cfg(target_os = "linux")'.dependencies]
nix = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions src/uu/sort/src/sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ use uucore::display::Quotable;
use uucore::error::strip_errno;
use uucore::error::{UError, UResult, USimpleError, UUsageError, set_exit_code};
use uucore::line_ending::LineEnding;
use uucore::parse_size::{ParseSizeError, Parser};
use uucore::shortcut_value_parser::ShortcutValueParser;
use uucore::parser::parse_size::{ParseSizeError, Parser};
use uucore::parser::shortcut_value_parser::ShortcutValueParser;
use uucore::version_cmp::version_cmp;
use uucore::{format_usage, help_about, help_section, help_usage, show_error};

Expand Down
2 changes: 1 addition & 1 deletion src/uu/split/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ path = "src/split.rs"
[dependencies]
clap = { workspace = true }
memchr = { workspace = true }
uucore = { workspace = true, features = ["fs"] }
uucore = { workspace = true, features = ["fs", "parser"] }
thiserror = { workspace = true }

[[bin]]
Expand Down
2 changes: 1 addition & 1 deletion src/uu/split/src/split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use std::path::Path;
use thiserror::Error;
use uucore::display::Quotable;
use uucore::error::{FromIo, UIoError, UResult, USimpleError, UUsageError};
use uucore::parse_size::parse_size_u64;
use uucore::parser::parse_size::parse_size_u64;

use uucore::uio_error;
use uucore::{format_usage, help_about, help_section, help_usage};
Expand Down
2 changes: 1 addition & 1 deletion src/uu/split/src/strategy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use clap::{ArgMatches, parser::ValueSource};
use thiserror::Error;
use uucore::{
display::Quotable,
parse_size::{ParseSizeError, parse_size_u64, parse_size_u64_max},
parser::parse_size::{ParseSizeError, parse_size_u64, parse_size_u64_max},
};

/// Sub-strategy of the [`Strategy::Number`]
Expand Down
2 changes: 1 addition & 1 deletion src/uu/stdbuf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ path = "src/stdbuf.rs"
[dependencies]
clap = { workspace = true }
tempfile = { workspace = true }
uucore = { workspace = true }
uucore = { workspace = true, features = ["parser"] }

[build-dependencies]
libstdbuf = { version = "0.0.30", package = "uu_stdbuf_libstdbuf", path = "src/libstdbuf" }
Expand Down
Loading
Loading