Skip to content

Commit 6243dd5

Browse files
committed
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.
1 parent a937aa5 commit 6243dd5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+90
-79
lines changed

fuzz/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ tempfile = "3.15.0"
1515
rand = { version = "0.9.0", features = ["small_rng"] }
1616
similar = "2.5.0"
1717

18-
uucore = { path = "../src/uucore/" }
18+
uucore = { path = "../src/uucore/", features = ["parser"] }
1919
uu_date = { path = "../src/uu/date/" }
2020
uu_test = { path = "../src/uu/test/" }
2121
uu_expr = { path = "../src/uu/expr/" }

fuzz/fuzz_targets/fuzz_parse_glob.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![no_main]
22

33
use libfuzzer_sys::fuzz_target;
4-
use uucore::parse_glob;
4+
use uucore::parser::parse_glob;
55

66
fuzz_target!(|data: &[u8]| {
77
if let Ok(s) = std::str::from_utf8(data) {

fuzz/fuzz_targets/fuzz_parse_size.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![no_main]
22

33
use libfuzzer_sys::fuzz_target;
4-
use uucore::parse_size::parse_size_u64;
4+
use uucore::parser::parse_size::parse_size_u64;
55

66
fuzz_target!(|data: &[u8]| {
77
if let Ok(s) = std::str::from_utf8(data) {

fuzz/fuzz_targets/fuzz_parse_time.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![no_main]
22

33
use libfuzzer_sys::fuzz_target;
4-
use uucore::parse_time;
4+
use uucore::parser::parse_time;
55

66
fuzz_target!(|data: &[u8]| {
77
if let Ok(s) = std::str::from_utf8(data) {

src/uu/cp/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ uucore = { workspace = true, features = [
3333
"entries",
3434
"fs",
3535
"fsxattr",
36+
"parser",
3637
"perms",
3738
"mode",
3839
"update-control",

src/uu/cp/src/cp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ use uucore::{backup_control, update_control};
4040
// requires these enum.
4141
pub use uucore::{backup_control::BackupMode, update_control::UpdateMode};
4242
use uucore::{
43-
format_usage, help_about, help_section, help_usage, prompt_yes,
44-
shortcut_value_parser::ShortcutValueParser, show_error, show_warning,
43+
format_usage, help_about, help_section, help_usage,
44+
parser::shortcut_value_parser::ShortcutValueParser, prompt_yes, show_error, show_warning,
4545
};
4646

4747
use crate::copydir::copy_directory;

src/uu/date/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ path = "src/date.rs"
2020
[dependencies]
2121
chrono = { workspace = true }
2222
clap = { workspace = true }
23-
uucore = { workspace = true, features = ["custom-tz-fmt"] }
23+
uucore = { workspace = true, features = ["custom-tz-fmt", "parser"] }
2424
parse_datetime = { workspace = true }
2525

2626
[target.'cfg(unix)'.dependencies]

src/uu/date/src/date.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use uucore::{format_usage, help_about, help_usage, show};
2323
#[cfg(windows)]
2424
use windows_sys::Win32::{Foundation::SYSTEMTIME, System::SystemInformation::SetSystemTime};
2525

26-
use uucore::shortcut_value_parser::ShortcutValueParser;
26+
use uucore::parser::shortcut_value_parser::ShortcutValueParser;
2727

2828
// Options
2929
const DATE: &str = "date";

src/uu/dd/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ path = "src/dd.rs"
2020
clap = { workspace = true }
2121
gcd = { workspace = true }
2222
libc = { workspace = true }
23-
uucore = { workspace = true, features = ["format", "quoting-style"] }
23+
uucore = { workspace = true, features = ["format", "parser", "quoting-style"] }
2424
thiserror = { workspace = true }
2525

2626
[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies]

src/uu/dd/src/parseargs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use crate::conversion_tables::ConversionTable;
1212
use thiserror::Error;
1313
use uucore::display::Quotable;
1414
use uucore::error::UError;
15-
use uucore::parse_size::{ParseSizeError, Parser as SizeParser};
15+
use uucore::parser::parse_size::{ParseSizeError, Parser as SizeParser};
1616
use uucore::show_warning;
1717

1818
/// Parser Errors describe errors with parser input

0 commit comments

Comments
 (0)