mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
uucore: Move parser to a feature
This will eventually be needed as we'll want parse_time to call into num_parser, which was previously contained in format feature.
This commit is contained in:
+1
-1
@@ -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/" }
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -33,6 +33,7 @@ uucore = { workspace = true, features = [
|
||||
"entries",
|
||||
"fs",
|
||||
"fsxattr",
|
||||
"parser",
|
||||
"perms",
|
||||
"mode",
|
||||
"update-control",
|
||||
|
||||
+2
-2
@@ -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;
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 }
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
+1
-1
@@ -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};
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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]
|
||||
|
||||
+3
-3
@@ -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;
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -34,6 +34,7 @@ uucore = { workspace = true, features = [
|
||||
"format",
|
||||
"fs",
|
||||
"fsxattr",
|
||||
"parser",
|
||||
"quoting-style",
|
||||
"version-cmp",
|
||||
] }
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user