all: change macros

- Change the main! proc_macro to a bin! macro_rules macro.
- Reexport uucore_procs from uucore
- Make utils to not import uucore_procs directly
- Remove the `syn` dependency and don't parse proc_macro input (hopefully for faster compile times)
This commit is contained in:
Terts Diepraam 2022-01-29 15:26:32 +01:00
parent 1dcd3b2c24
commit eb82015b23
308 changed files with 222 additions and 716 deletions

103
Cargo.lock generated
View file

@ -2038,7 +2038,6 @@ dependencies = [
"clap 3.0.10",
"platform-info",
"uucore",
"uucore_procs",
]
[[package]]
@ -2047,7 +2046,6 @@ version = "0.0.12"
dependencies = [
"clap 3.0.10",
"uucore",
"uucore_procs",
]
[[package]]
@ -2056,7 +2054,6 @@ version = "0.0.12"
dependencies = [
"uu_base32",
"uucore",
"uucore_procs",
]
[[package]]
@ -2065,7 +2062,6 @@ version = "0.0.12"
dependencies = [
"clap 3.0.10",
"uucore",
"uucore_procs",
]
[[package]]
@ -2075,7 +2071,6 @@ dependencies = [
"clap 3.0.10",
"uu_base32",
"uucore",
"uucore_procs",
]
[[package]]
@ -2088,7 +2083,6 @@ dependencies = [
"thiserror",
"unix_socket",
"uucore",
"uucore_procs",
"winapi-util",
]
@ -2102,7 +2096,6 @@ dependencies = [
"selinux",
"thiserror",
"uucore",
"uucore_procs",
]
[[package]]
@ -2111,7 +2104,6 @@ version = "0.0.12"
dependencies = [
"clap 3.0.10",
"uucore",
"uucore_procs",
]
[[package]]
@ -2121,7 +2113,6 @@ dependencies = [
"clap 3.0.10",
"libc",
"uucore",
"uucore_procs",
"walkdir",
]
@ -2131,7 +2122,6 @@ version = "0.0.12"
dependencies = [
"clap 3.0.10",
"uucore",
"uucore_procs",
]
[[package]]
@ -2140,7 +2130,6 @@ version = "0.0.12"
dependencies = [
"clap 3.0.10",
"uucore",
"uucore_procs",
]
[[package]]
@ -2150,7 +2139,6 @@ dependencies = [
"clap 3.0.10",
"libc",
"uucore",
"uucore_procs",
]
[[package]]
@ -2160,7 +2148,6 @@ dependencies = [
"clap 3.0.10",
"libc",
"uucore",
"uucore_procs",
]
[[package]]
@ -2175,7 +2162,6 @@ dependencies = [
"quick-error 1.2.3",
"selinux",
"uucore",
"uucore_procs",
"walkdir",
"winapi 0.3.9",
"xattr",
@ -2189,7 +2175,6 @@ dependencies = [
"regex",
"thiserror",
"uucore",
"uucore_procs",
]
[[package]]
@ -2201,7 +2186,6 @@ dependencies = [
"clap 3.0.10",
"memchr 2.4.1",
"uucore",
"uucore_procs",
]
[[package]]
@ -2212,7 +2196,6 @@ dependencies = [
"clap 3.0.10",
"libc",
"uucore",
"uucore_procs",
"winapi 0.3.9",
]
@ -2227,7 +2210,6 @@ dependencies = [
"signal-hook",
"tempfile",
"uucore",
"uucore_procs",
]
[[package]]
@ -2237,7 +2219,6 @@ dependencies = [
"clap 3.0.10",
"number_prefix",
"uucore",
"uucore_procs",
]
[[package]]
@ -2247,7 +2228,6 @@ dependencies = [
"clap 3.0.10",
"glob",
"uucore",
"uucore_procs",
]
[[package]]
@ -2257,7 +2237,6 @@ dependencies = [
"clap 3.0.10",
"libc",
"uucore",
"uucore_procs",
]
[[package]]
@ -2267,7 +2246,6 @@ dependencies = [
"chrono",
"clap 3.0.10",
"uucore",
"uucore_procs",
"winapi 0.3.9",
]
@ -2277,7 +2255,6 @@ version = "0.0.12"
dependencies = [
"clap 3.0.10",
"uucore",
"uucore_procs",
]
[[package]]
@ -2288,7 +2265,6 @@ dependencies = [
"libc",
"rust-ini",
"uucore",
"uucore_procs",
]
[[package]]
@ -2298,7 +2274,6 @@ dependencies = [
"clap 3.0.10",
"unicode-width",
"uucore",
"uucore_procs",
]
[[package]]
@ -2311,7 +2286,6 @@ dependencies = [
"num-traits",
"onig",
"uucore",
"uucore_procs",
]
[[package]]
@ -2326,7 +2300,6 @@ dependencies = [
"rand",
"smallvec",
"uucore",
"uucore_procs",
]
[[package]]
@ -2335,7 +2308,6 @@ version = "0.0.12"
dependencies = [
"clap 3.0.10",
"uucore",
"uucore_procs",
]
[[package]]
@ -2346,7 +2318,6 @@ dependencies = [
"libc",
"unicode-width",
"uucore",
"uucore_procs",
]
[[package]]
@ -2355,7 +2326,6 @@ version = "0.0.12"
dependencies = [
"clap 3.0.10",
"uucore",
"uucore_procs",
]
[[package]]
@ -2364,7 +2334,6 @@ version = "0.0.12"
dependencies = [
"clap 3.0.10",
"uucore",
"uucore_procs",
]
[[package]]
@ -2384,7 +2353,6 @@ dependencies = [
"sha2",
"sha3",
"uucore",
"uucore_procs",
]
[[package]]
@ -2394,7 +2362,6 @@ dependencies = [
"clap 3.0.10",
"memchr 2.4.1",
"uucore",
"uucore_procs",
]
[[package]]
@ -2404,7 +2371,6 @@ dependencies = [
"clap 3.0.10",
"libc",
"uucore",
"uucore_procs",
]
[[package]]
@ -2415,7 +2381,6 @@ dependencies = [
"hostname",
"libc",
"uucore",
"uucore_procs",
"winapi 0.3.9",
]
@ -2426,7 +2391,6 @@ dependencies = [
"clap 3.0.10",
"selinux",
"uucore",
"uucore_procs",
]
[[package]]
@ -2439,7 +2403,6 @@ dependencies = [
"libc",
"time",
"uucore",
"uucore_procs",
]
[[package]]
@ -2448,7 +2411,6 @@ version = "0.0.12"
dependencies = [
"clap 3.0.10",
"uucore",
"uucore_procs",
]
[[package]]
@ -2458,7 +2420,6 @@ dependencies = [
"clap 3.0.10",
"libc",
"uucore",
"uucore_procs",
]
[[package]]
@ -2468,7 +2429,6 @@ dependencies = [
"clap 3.0.10",
"libc",
"uucore",
"uucore_procs",
]
[[package]]
@ -2478,7 +2438,6 @@ dependencies = [
"clap 3.0.10",
"libc",
"uucore",
"uucore_procs",
]
[[package]]
@ -2488,7 +2447,6 @@ dependencies = [
"clap 3.0.10",
"libc",
"uucore",
"uucore_procs",
]
[[package]]
@ -2508,7 +2466,6 @@ dependencies = [
"termsize",
"unicode-width",
"uucore",
"uucore_procs",
]
[[package]]
@ -2518,7 +2475,6 @@ dependencies = [
"clap 3.0.10",
"libc",
"uucore",
"uucore_procs",
]
[[package]]
@ -2528,7 +2484,6 @@ dependencies = [
"clap 3.0.10",
"libc",
"uucore",
"uucore_procs",
]
[[package]]
@ -2538,7 +2493,6 @@ dependencies = [
"clap 3.0.10",
"libc",
"uucore",
"uucore_procs",
]
[[package]]
@ -2549,7 +2503,6 @@ dependencies = [
"rand",
"tempfile",
"uucore",
"uucore_procs",
]
[[package]]
@ -2565,7 +2518,6 @@ dependencies = [
"unicode-segmentation",
"unicode-width",
"uucore",
"uucore_procs",
]
[[package]]
@ -2575,7 +2527,6 @@ dependencies = [
"clap 3.0.10",
"fs_extra",
"uucore",
"uucore_procs",
]
[[package]]
@ -2586,7 +2537,6 @@ dependencies = [
"libc",
"nix 0.23.1",
"uucore",
"uucore_procs",
]
[[package]]
@ -2600,7 +2550,6 @@ dependencies = [
"regex",
"regex-syntax",
"uucore",
"uucore_procs",
]
[[package]]
@ -2611,7 +2560,6 @@ dependencies = [
"clap 3.0.10",
"libc",
"uucore",
"uucore_procs",
]
[[package]]
@ -2622,7 +2570,6 @@ dependencies = [
"libc",
"num_cpus",
"uucore",
"uucore_procs",
]
[[package]]
@ -2631,7 +2578,6 @@ version = "0.0.12"
dependencies = [
"clap 3.0.10",
"uucore",
"uucore_procs",
]
[[package]]
@ -2643,7 +2589,6 @@ dependencies = [
"half",
"libc",
"uucore",
"uucore_procs",
]
[[package]]
@ -2652,7 +2597,6 @@ version = "0.0.12"
dependencies = [
"clap 3.0.10",
"uucore",
"uucore_procs",
]
[[package]]
@ -2662,7 +2606,6 @@ dependencies = [
"clap 3.0.10",
"libc",
"uucore",
"uucore_procs",
]
[[package]]
@ -2671,7 +2614,6 @@ version = "0.0.12"
dependencies = [
"clap 3.0.10",
"uucore",
"uucore_procs",
]
[[package]]
@ -2685,7 +2627,6 @@ dependencies = [
"quick-error 2.0.1",
"regex",
"uucore",
"uucore_procs",
]
[[package]]
@ -2694,7 +2635,6 @@ version = "0.0.12"
dependencies = [
"clap 3.0.10",
"uucore",
"uucore_procs",
]
[[package]]
@ -2704,7 +2644,6 @@ dependencies = [
"clap 3.0.10",
"itertools 0.8.2",
"uucore",
"uucore_procs",
]
[[package]]
@ -2718,7 +2657,6 @@ dependencies = [
"regex",
"regex-syntax",
"uucore",
"uucore_procs",
]
[[package]]
@ -2727,7 +2665,6 @@ version = "0.0.12"
dependencies = [
"clap 3.0.10",
"uucore",
"uucore_procs",
]
[[package]]
@ -2737,7 +2674,6 @@ dependencies = [
"clap 3.0.10",
"libc",
"uucore",
"uucore_procs",
]
[[package]]
@ -2746,7 +2682,6 @@ version = "0.0.12"
dependencies = [
"clap 3.0.10",
"uucore",
"uucore_procs",
]
[[package]]
@ -2755,7 +2690,6 @@ version = "0.0.12"
dependencies = [
"clap 3.0.10",
"uucore",
"uucore_procs",
]
[[package]]
@ -2765,7 +2699,6 @@ dependencies = [
"clap 3.0.10",
"remove_dir_all",
"uucore",
"uucore_procs",
"walkdir",
"winapi 0.3.9",
]
@ -2777,7 +2710,6 @@ dependencies = [
"clap 3.0.10",
"libc",
"uucore",
"uucore_procs",
]
[[package]]
@ -2790,7 +2722,6 @@ dependencies = [
"selinux",
"thiserror",
"uucore",
"uucore_procs",
]
[[package]]
@ -2802,7 +2733,6 @@ dependencies = [
"num-bigint",
"num-traits",
"uucore",
"uucore_procs",
]
[[package]]
@ -2813,7 +2743,6 @@ dependencies = [
"libc",
"rand",
"uucore",
"uucore_procs",
]
[[package]]
@ -2824,7 +2753,6 @@ dependencies = [
"rand",
"rand_core",
"uucore",
"uucore_procs",
]
[[package]]
@ -2833,7 +2761,6 @@ version = "0.0.12"
dependencies = [
"clap 3.0.10",
"uucore",
"uucore_procs",
]
[[package]]
@ -2853,7 +2780,6 @@ dependencies = [
"tempfile",
"unicode-width",
"uucore",
"uucore_procs",
]
[[package]]
@ -2862,7 +2788,6 @@ version = "0.0.12"
dependencies = [
"clap 3.0.10",
"uucore",
"uucore_procs",
]
[[package]]
@ -2871,7 +2796,6 @@ version = "0.0.12"
dependencies = [
"clap 3.0.10",
"uucore",
"uucore_procs",
]
[[package]]
@ -2882,7 +2806,6 @@ dependencies = [
"tempfile",
"uu_stdbuf_libstdbuf",
"uucore",
"uucore_procs",
]
[[package]]
@ -2893,7 +2816,6 @@ dependencies = [
"cpp_build",
"libc",
"uucore",
"uucore_procs",
]
[[package]]
@ -2902,7 +2824,6 @@ version = "0.0.12"
dependencies = [
"clap 3.0.10",
"uucore",
"uucore_procs",
]
[[package]]
@ -2912,7 +2833,6 @@ dependencies = [
"clap 3.0.10",
"libc",
"uucore",
"uucore_procs",
"winapi 0.3.9",
]
@ -2925,7 +2845,6 @@ dependencies = [
"memmap2",
"regex",
"uucore",
"uucore_procs",
]
[[package]]
@ -2937,7 +2856,6 @@ dependencies = [
"nix 0.23.1",
"redox_syscall",
"uucore",
"uucore_procs",
"winapi 0.3.9",
]
@ -2949,7 +2867,6 @@ dependencies = [
"libc",
"retain_mut",
"uucore",
"uucore_procs",
]
[[package]]
@ -2960,7 +2877,6 @@ dependencies = [
"libc",
"redox_syscall",
"uucore",
"uucore_procs",
]
[[package]]
@ -2971,7 +2887,6 @@ dependencies = [
"libc",
"nix 0.23.1",
"uucore",
"uucore_procs",
]
[[package]]
@ -2982,7 +2897,6 @@ dependencies = [
"filetime",
"time",
"uucore",
"uucore_procs",
]
[[package]]
@ -2992,7 +2906,6 @@ dependencies = [
"clap 3.0.10",
"nom",
"uucore",
"uucore_procs",
]
[[package]]
@ -3001,7 +2914,6 @@ version = "0.0.12"
dependencies = [
"clap 3.0.10",
"uucore",
"uucore_procs",
]
[[package]]
@ -3010,7 +2922,6 @@ version = "0.0.12"
dependencies = [
"clap 3.0.10",
"uucore",
"uucore_procs",
]
[[package]]
@ -3019,7 +2930,6 @@ version = "0.0.12"
dependencies = [
"clap 3.0.10",
"uucore",
"uucore_procs",
]
[[package]]
@ -3030,7 +2940,6 @@ dependencies = [
"clap 3.0.10",
"libc",
"uucore",
"uucore_procs",
]
[[package]]
@ -3040,7 +2949,6 @@ dependencies = [
"clap 3.0.10",
"platform-info",
"uucore",
"uucore_procs",
]
[[package]]
@ -3050,7 +2958,6 @@ dependencies = [
"clap 3.0.10",
"unicode-width",
"uucore",
"uucore_procs",
]
[[package]]
@ -3061,7 +2968,6 @@ dependencies = [
"strum",
"strum_macros",
"uucore",
"uucore_procs",
]
[[package]]
@ -3070,7 +2976,6 @@ version = "0.0.12"
dependencies = [
"clap 3.0.10",
"uucore",
"uucore_procs",
]
[[package]]
@ -3080,7 +2985,6 @@ dependencies = [
"chrono",
"clap 3.0.10",
"uucore",
"uucore_procs",
]
[[package]]
@ -3089,7 +2993,6 @@ version = "0.0.12"
dependencies = [
"clap 3.0.10",
"uucore",
"uucore_procs",
]
[[package]]
@ -3103,7 +3006,6 @@ dependencies = [
"unicode-width",
"utf-8",
"uucore",
"uucore_procs",
]
[[package]]
@ -3112,7 +3014,6 @@ version = "0.0.12"
dependencies = [
"clap 3.0.10",
"uucore",
"uucore_procs",
]
[[package]]
@ -3122,7 +3023,6 @@ dependencies = [
"clap 3.0.10",
"libc",
"uucore",
"uucore_procs",
"winapi 0.3.9",
]
@ -3133,7 +3033,6 @@ dependencies = [
"clap 3.0.10",
"nix 0.23.1",
"uucore",
"uucore_procs",
]
[[package]]
@ -3154,6 +3053,7 @@ dependencies = [
"termion",
"thiserror",
"time",
"uucore_procs",
"walkdir",
"wild",
"winapi 0.3.9",
@ -3167,7 +3067,6 @@ version = "0.0.12"
dependencies = [
"proc-macro2",
"quote 1.0.14",
"syn",
]
[[package]]

View file

@ -18,11 +18,7 @@ path = "src/arch.rs"
platform-info = "0.2"
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
uucore = { version=">=0.0.11", package="uucore", path="../../uucore" }
uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" }
[[bin]]
name = "arch"
path = "src/main.rs"
[package.metadata.cargo-udeps.ignore]
normal = ["uucore_procs"]

View file

@ -14,7 +14,7 @@ use uucore::error::{FromIo, UResult};
static ABOUT: &str = "Display machine architecture";
static SUMMARY: &str = "Determine architecture name for current machine.";
#[uucore_procs::gen_uumain]
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
uu_app().get_matches_from(args);

View file

@ -1 +1 @@
uucore_procs::main!(uu_arch);
uucore::bin!(uu_arch);

View file

@ -17,11 +17,7 @@ path = "src/base32.rs"
[dependencies]
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features = ["encoding"] }
uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" }
[[bin]]
name = "base32"
path = "src/main.rs"
[package.metadata.cargo-udeps.ignore]
normal = ["uucore_procs"]

View file

@ -26,7 +26,7 @@ fn usage() -> String {
format!("{0} [OPTION]... [FILE]", uucore::execution_phrase())
}
#[uucore_procs::gen_uumain]
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let format = Format::Base32;
let usage = usage();

View file

@ -1 +1 @@
uucore_procs::main!(uu_base32);
uucore::bin!(uu_base32);

View file

@ -16,12 +16,8 @@ path = "src/base64.rs"
[dependencies]
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features = ["encoding"] }
uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" }
uu_base32 = { version=">=0.0.8", package="uu_base32", path="../base32"}
[[bin]]
name = "base64"
path = "src/main.rs"
[package.metadata.cargo-udeps.ignore]
normal = ["uucore_procs"]

View file

@ -27,7 +27,7 @@ fn usage() -> String {
format!("{0} [OPTION]... [FILE]", uucore::execution_phrase())
}
#[uucore_procs::gen_uumain]
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let format = Format::Base64;
let usage = usage();

View file

@ -1 +1 @@
uucore_procs::main!(uu_base64);
uucore::bin!(uu_base64);

View file

@ -17,11 +17,7 @@ path = "src/basename.rs"
[dependencies]
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
uucore = { version=">=0.0.11", package="uucore", path="../../uucore" }
uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" }
[[bin]]
name = "basename"
path = "src/main.rs"
[package.metadata.cargo-udeps.ignore]
normal = ["uucore_procs"]

View file

@ -31,7 +31,7 @@ pub mod options {
pub static ZERO: &str = "zero";
}
#[uucore_procs::gen_uumain]
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let args = args
.collect_str(InvalidEncodingHandling::ConvertLossy)

View file

@ -1 +1 @@
uucore_procs::main!(uu_basename);
uucore::bin!(uu_basename);

View file

@ -17,12 +17,8 @@ path = "src/basenc.rs"
[dependencies]
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features = ["encoding"] }
uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" }
uu_base32 = { version=">=0.0.8", package="uu_base32", path="../base32"}
[[bin]]
name = "basenc"
path = "src/main.rs"
[package.metadata.cargo-udeps.ignore]
normal = ["uucore_procs"]

View file

@ -65,7 +65,7 @@ fn parse_cmd_args(args: impl uucore::Args) -> UResult<(Config, Format)> {
Ok((config, format))
}
#[uucore_procs::gen_uumain]
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let (config, format) = parse_cmd_args(args)?;
// Create a reference to stdin so we can return a locked stdin from

View file

@ -1 +1 @@
uucore_procs::main!(uu_basenc);
uucore::bin!(uu_basenc);

View file

@ -19,7 +19,6 @@ clap = { version = "3.0", features = ["wrap_help", "cargo"] }
thiserror = "1.0"
atty = "0.2"
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["fs", "pipes"] }
uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" }
[target.'cfg(unix)'.dependencies]
unix_socket = "0.5.0"
@ -31,6 +30,3 @@ winapi-util = "0.1.5"
[[bin]]
name = "cat"
path = "src/main.rs"
[package.metadata.cargo-udeps.ignore]
normal = ["uucore_procs"]

View file

@ -182,7 +182,7 @@ mod options {
pub static SHOW_NONPRINTING: &str = "show-nonprinting";
}
#[uucore_procs::gen_uumain]
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let args = args
.collect_str(InvalidEncodingHandling::Ignore)

View file

@ -1 +1 @@
uucore_procs::main!(uu_cat);
uucore::bin!(uu_cat);

View file

@ -16,7 +16,6 @@ path = "src/chcon.rs"
[dependencies]
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
uucore = { version = ">=0.0.9", package="uucore", path="../../uucore", features=["entries", "fs", "perms"] }
uucore_procs = { version = ">=0.0.6", package="uucore_procs", path="../../uucore_procs" }
selinux = { version = "0.2" }
fts-sys = { version = "0.2" }
thiserror = { version = "1.0" }
@ -25,6 +24,3 @@ libc = { version = "0.2" }
[[bin]]
name = "chcon"
path = "src/main.rs"
[package.metadata.cargo-udeps.ignore]
normal = ["uucore_procs"]

View file

@ -61,7 +61,7 @@ fn get_usage() -> String {
)
}
#[uucore_procs::gen_uumain]
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let usage = get_usage();

View file

@ -1 +1 @@
uucore_procs::main!(uu_chcon);
uucore::bin!(uu_chcon);

View file

@ -17,11 +17,7 @@ path = "src/chgrp.rs"
[dependencies]
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["entries", "fs", "perms"] }
uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" }
[[bin]]
name = "chgrp"
path = "src/main.rs"
[package.metadata.cargo-udeps.ignore]
normal = ["uucore_procs"]

View file

@ -51,7 +51,7 @@ fn parse_gid_and_uid(matches: &ArgMatches) -> UResult<(Option<u32>, Option<u32>,
Ok((dest_gid, None, IfFrom::All))
}
#[uucore_procs::gen_uumain]
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let usage = get_usage();

View file

@ -1 +1 @@
uucore_procs::main!(uu_chgrp);
uucore::bin!(uu_chgrp);

View file

@ -18,12 +18,8 @@ path = "src/chmod.rs"
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
libc = "0.2.42"
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["fs", "mode"] }
uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" }
walkdir = "2.2"
[[bin]]
name = "chmod"
path = "src/main.rs"
[package.metadata.cargo-udeps.ignore]
normal = ["uucore_procs"]

View file

@ -48,7 +48,7 @@ fn get_long_usage() -> String {
String::from("Each MODE is of the form '[ugoa]*([-+=]([rwxXst]*|[ugo]))+|[-+=]?[0-7]+'.")
}
#[uucore_procs::gen_uumain]
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let mut args = args
.collect_str(InvalidEncodingHandling::ConvertLossy)

View file

@ -1 +1 @@
uucore_procs::main!(uu_chmod);
uucore::bin!(uu_chmod);

View file

@ -17,11 +17,7 @@ path = "src/chown.rs"
[dependencies]
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["entries", "fs", "perms"] }
uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" }
[[bin]]
name = "chown"
path = "src/main.rs"
[package.metadata.cargo-udeps.ignore]
normal = ["uucore_procs"]

View file

@ -54,7 +54,7 @@ fn parse_gid_uid_and_filter(matches: &ArgMatches) -> UResult<(Option<u32>, Optio
Ok((dest_gid, dest_uid, filter))
}
#[uucore_procs::gen_uumain]
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let usage = get_usage();

View file

@ -1 +1 @@
uucore_procs::main!(uu_chown);
uucore::bin!(uu_chown);

View file

@ -17,11 +17,7 @@ path = "src/chroot.rs"
[dependencies]
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["entries"] }
uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" }
[[bin]]
name = "chroot"
path = "src/main.rs"
[package.metadata.cargo-udeps.ignore]
normal = ["uucore_procs"]

View file

@ -31,7 +31,7 @@ mod options {
pub const COMMAND: &str = "command";
}
#[uucore_procs::gen_uumain]
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let args = args
.collect_str(InvalidEncodingHandling::ConvertLossy)

View file

@ -1 +1 @@
uucore_procs::main!(uu_chroot);
uucore::bin!(uu_chroot);

View file

@ -18,11 +18,7 @@ path = "src/cksum.rs"
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
libc = "0.2.42"
uucore = { version=">=0.0.11", package="uucore", path="../../uucore" }
uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" }
[[bin]]
name = "cksum"
path = "src/main.rs"
[package.metadata.cargo-udeps.ignore]
normal = ["uucore_procs"]

View file

@ -112,7 +112,7 @@ mod options {
pub static FILE: &str = "file";
}
#[uucore_procs::gen_uumain]
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let args = args
.collect_str(InvalidEncodingHandling::Ignore)

View file

@ -1 +1 @@
uucore_procs::main!(uu_cksum);
uucore::bin!(uu_cksum);

View file

@ -18,11 +18,7 @@ path = "src/comm.rs"
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
libc = "0.2.42"
uucore = { version=">=0.0.11", package="uucore", path="../../uucore" }
uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" }
[[bin]]
name = "comm"
path = "src/main.rs"
[package.metadata.cargo-udeps.ignore]
normal = ["uucore_procs"]

View file

@ -130,7 +130,7 @@ fn open_file(name: &str) -> io::Result<LineReader> {
}
}
#[uucore_procs::gen_uumain]
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let usage = usage();
let args = args

View file

@ -1 +1 @@
uucore_procs::main!(uu_comm);
uucore::bin!(uu_comm);

View file

@ -25,7 +25,6 @@ libc = "0.2.85"
quick-error = "1.2.3"
selinux = { version="0.2", optional=true }
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["entries", "fs", "perms", "mode"] }
uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" }
walkdir = "2.2"
[target.'cfg(target_os = "linux")'.dependencies]
@ -45,6 +44,3 @@ path = "src/main.rs"
[features]
feat_selinux = ["selinux"]
feat_acl = ["exacl"]
[package.metadata.cargo-udeps.ignore]
normal = ["uucore_procs"]

View file

@ -454,7 +454,7 @@ pub fn uu_app<'a>() -> App<'a> {
.multiple_occurrences(true))
}
#[uucore_procs::gen_uumain]
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let usage = usage();
let matches = uu_app()

View file

@ -1 +1 @@
uucore_procs::main!(uu_cp);
uucore::bin!(uu_cp);

View file

@ -19,11 +19,7 @@ clap = { version = "3.0", features = ["wrap_help", "cargo"] }
thiserror = "1.0"
regex = "1.0.0"
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["entries", "fs"] }
uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" }
[[bin]]
name = "csplit"
path = "src/main.rs"
[package.metadata.cargo-udeps.ignore]
normal = ["uucore_procs"]

View file

@ -717,7 +717,7 @@ mod tests {
}
}
#[uucore_procs::gen_uumain]
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let usage = usage();
let args = args

View file

@ -1 +1 @@
uucore_procs::main!(uu_csplit);
uucore::bin!(uu_csplit);

View file

@ -17,7 +17,6 @@ path = "src/cut.rs"
[dependencies]
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
uucore = { version=">=0.0.11", package="uucore", path="../../uucore" }
uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" }
memchr = "2"
bstr = "0.2"
atty = "0.2"
@ -25,6 +24,3 @@ atty = "0.2"
[[bin]]
name = "cut"
path = "src/main.rs"
[package.metadata.cargo-udeps.ignore]
normal = ["uucore_procs"]

View file

@ -395,7 +395,7 @@ mod options {
pub const FILE: &str = "file";
}
#[uucore_procs::gen_uumain]
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let args = args
.collect_str(InvalidEncodingHandling::Ignore)

View file

@ -1 +1 @@
uucore_procs::main!(uu_cut);
uucore::bin!(uu_cut);

View file

@ -18,7 +18,6 @@ path = "src/date.rs"
chrono = "^0.4.11"
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
uucore = { version=">=0.0.11", package="uucore", path="../../uucore" }
uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" }
[target.'cfg(unix)'.dependencies]
libc = "0.2"
@ -29,6 +28,3 @@ winapi = { version = "0.3", features = ["minwinbase", "sysinfoapi", "minwindef"]
[[bin]]
name = "date"
path = "src/main.rs"
[package.metadata.cargo-udeps.ignore]
normal = ["uucore_procs"]

View file

@ -140,7 +140,7 @@ impl<'a> From<&'a str> for Rfc3339Format {
}
}
#[uucore_procs::gen_uumain]
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let syntax = format!(
"{0} [OPTION]... [+FORMAT]...

View file

@ -1 +1 @@
uucore_procs::main!(uu_date);
uucore::bin!(uu_date);

View file

@ -20,7 +20,6 @@ clap = { version = "3.0", features = ["wrap_help", "cargo"] }
gcd = "2.0"
libc = "0.2"
uucore = { version=">=0.0.8", package="uucore", path="../../uucore" }
uucore_procs = { version=">=0.0.5", package="uucore_procs", path="../../uucore_procs" }
[dev-dependencies]
tempfile = "^3"
@ -31,6 +30,3 @@ signal-hook = "0.3.9"
[[bin]]
name = "dd"
path = "src/main.rs"
[package.metadata.cargo-udeps.ignore]
normal = ["uucore_procs"]

View file

@ -907,7 +907,7 @@ fn append_dashes_if_not_present(mut acc: Vec<String>, mut s: String) -> Vec<Stri
acc
}
#[uucore_procs::gen_uumain]
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let dashed_args = args
.collect_str(InvalidEncodingHandling::Ignore)

View file

@ -1 +1 @@
uucore_procs::main!(uu_dd); // spell-checker:ignore procs uucore
uucore::bin!(uu_dd); // spell-checker:ignore procs uucore

View file

@ -18,11 +18,7 @@ path = "src/df.rs"
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
number_prefix = "0.4"
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["libc", "fsext"] }
uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" }
[[bin]]
name = "df"
path = "src/main.rs"
[package.metadata.cargo-udeps.ignore]
normal = ["uucore_procs"]

View file

@ -277,7 +277,7 @@ impl UError for DfError {
}
}
#[uucore_procs::gen_uumain]
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let usage = usage();
let matches = uu_app().override_usage(&usage[..]).get_matches_from(args);

View file

@ -1 +1 @@
uucore_procs::main!(uu_df);
uucore::bin!(uu_df);

View file

@ -18,11 +18,7 @@ path = "src/dircolors.rs"
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
glob = "0.3.0"
uucore = { version=">=0.0.11", package="uucore", path="../../uucore" }
uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" }
[[bin]]
name = "dircolors"
path = "src/main.rs"
[package.metadata.cargo-udeps.ignore]
normal = ["uucore_procs"]

View file

@ -65,7 +65,7 @@ fn usage() -> String {
format!("{0} {1}", uucore::execution_phrase(), SYNTAX)
}
#[uucore_procs::gen_uumain]
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let args = args
.collect_str(InvalidEncodingHandling::Ignore)

View file

@ -1 +1 @@
uucore_procs::main!(uu_dircolors);
uucore::bin!(uu_dircolors);

View file

@ -18,7 +18,6 @@ path = "src/dirname.rs"
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
libc = "0.2.42"
uucore = { version=">=0.0.11", package="uucore", path="../../uucore" }
uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" }
[[bin]]
name = "dirname"

View file

@ -29,7 +29,7 @@ fn get_long_usage() -> String {
)
}
#[uucore_procs::gen_uumain]
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let args = args
.collect_str(InvalidEncodingHandling::ConvertLossy)

View file

@ -1 +1 @@
uucore_procs::main!(uu_dirname);
uucore::bin!(uu_dirname);

View file

@ -18,7 +18,6 @@ path = "src/du.rs"
chrono = "^0.4.11"
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
uucore = { version=">=0.0.11", package="uucore", path="../../uucore" }
uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" }
[target.'cfg(target_os = "windows")'.dependencies]
winapi = { version="0.3", features=[] }

View file

@ -452,7 +452,7 @@ impl UError for DuError {
}
}
#[uucore_procs::gen_uumain]
#[uucore::main]
#[allow(clippy::cognitive_complexity)]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let args = args

View file

@ -1 +1 @@
uucore_procs::main!(uu_du);
uucore::bin!(uu_du);

View file

@ -17,7 +17,6 @@ path = "src/echo.rs"
[dependencies]
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
uucore = { version=">=0.0.11", package="uucore", path="../../uucore" }
uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" }
[[bin]]
name = "echo"

View file

@ -111,7 +111,7 @@ fn print_escaped(input: &str, mut output: impl Write) -> io::Result<bool> {
Ok(should_stop)
}
#[uucore_procs::gen_uumain]
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let args = args
.collect_str(InvalidEncodingHandling::ConvertLossy)

View file

@ -1 +1 @@
uucore_procs::main!(uu_echo);
uucore::bin!(uu_echo);

View file

@ -19,7 +19,6 @@ clap = { version = "3.0", features = ["wrap_help", "cargo"] }
libc = "0.2.42"
rust-ini = "0.17.0"
uucore = { version=">=0.0.11", package="uucore", path="../../uucore" }
uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" }
[[bin]]
name = "env"

View file

@ -319,7 +319,7 @@ fn run_env(args: impl uucore::Args) -> UResult<()> {
Ok(())
}
#[uucore_procs::gen_uumain]
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
run_env(args)
}

View file

@ -1 +1 @@
uucore_procs::main!(uu_env);
uucore::bin!(uu_env);

View file

@ -18,11 +18,7 @@ path = "src/expand.rs"
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
unicode-width = "0.1.5"
uucore = { version=">=0.0.11", package="uucore", path="../../uucore" }
uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" }
[[bin]]
name = "expand"
path = "src/main.rs"
[package.metadata.cargo-udeps.ignore]
normal = ["uucore_procs"]

View file

@ -171,7 +171,7 @@ impl Options {
}
}
#[uucore_procs::gen_uumain]
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let usage = usage();
let matches = uu_app().override_usage(&usage[..]).get_matches_from(args);

View file

@ -1 +1 @@
uucore_procs::main!(uu_expand);
uucore::bin!(uu_expand);

View file

@ -21,11 +21,7 @@ num-bigint = "0.4.0"
num-traits = "0.2.14"
onig = "~4.3.2"
uucore = { version=">=0.0.11", package="uucore", path="../../uucore" }
uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" }
[[bin]]
name = "expr"
path = "src/main.rs"
[package.metadata.cargo-udeps.ignore]
normal = ["uucore_procs"]

View file

@ -22,7 +22,7 @@ pub fn uu_app<'a>() -> App<'a> {
.arg(Arg::new(HELP).long(HELP))
}
#[uucore_procs::gen_uumain]
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let args = args
.collect_str(InvalidEncodingHandling::ConvertLossy)

View file

@ -1 +1 @@
uucore_procs::main!(uu_expr);
uucore::bin!(uu_expr);

View file

@ -21,19 +21,14 @@ num-traits = "0.2.13" # Needs at least version 0.2.13 for "OverflowingAdd"
rand = { version = "0.8", features = ["small_rng"] }
smallvec = "1.7" # TODO(nicoo): Use `union` feature, requires Rust 1.49 or later.
uucore = { version = ">=0.0.8", package = "uucore", path = "../../uucore" }
uucore_procs = { version=">=0.0.8", package = "uucore_procs", path = "../../uucore_procs" }
[dev-dependencies]
paste = "0.1.18"
quickcheck = "1.0.3"
[[bin]]
name = "factor"
path = "src/main.rs"
[lib]
path = "src/cli.rs"
[package.metadata.cargo-udeps.ignore]
normal = ["uucore_procs"]

View file

@ -44,7 +44,7 @@ fn print_factors_str(
})
}
#[uucore_procs::gen_uumain]
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let matches = uu_app().get_matches_from(args);
let stdout = stdout();

View file

@ -1 +1 @@
uucore_procs::main!(uu_factor);
uucore::bin!(uu_factor);

View file

@ -17,7 +17,6 @@ path = "src/false.rs"
[dependencies]
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
uucore = { version=">=0.0.11", package="uucore", path="../../uucore" }
uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" }
[[bin]]
name = "false"

View file

@ -8,7 +8,7 @@
use clap::App;
use uucore::error::UResult;
#[uucore_procs::gen_uumain]
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
uu_app().get_matches_from(args);
Err(1.into())

View file

@ -1 +1 @@
uucore_procs::main!(uu_false);
uucore::bin!(uu_false);

View file

@ -19,11 +19,7 @@ clap = { version = "3.0", features = ["wrap_help", "cargo"] }
libc = "0.2.42"
unicode-width = "0.1.5"
uucore = { version=">=0.0.11", package="uucore", path="../../uucore" }
uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" }
[[bin]]
name = "fmt"
path = "src/main.rs"
[package.metadata.cargo-udeps.ignore]
normal = ["uucore_procs"]

View file

@ -66,7 +66,7 @@ pub struct FmtOptions {
tabwidth: usize,
}
#[uucore_procs::gen_uumain]
#[uucore::main]
#[allow(clippy::cognitive_complexity)]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let usage = usage();

View file

@ -1 +1 @@
uucore_procs::main!(uu_fmt);
uucore::bin!(uu_fmt);

View file

@ -17,11 +17,7 @@ path = "src/fold.rs"
[dependencies]
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
uucore = { version=">=0.0.11", package="uucore", path="../../uucore" }
uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" }
[[bin]]
name = "fold"
path = "src/main.rs"
[package.metadata.cargo-udeps.ignore]
normal = ["uucore_procs"]

View file

@ -29,7 +29,7 @@ mod options {
pub const FILE: &str = "file";
}
#[uucore_procs::gen_uumain]
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let args = args
.collect_str(InvalidEncodingHandling::ConvertLossy)

View file

@ -1 +1 @@
uucore_procs::main!(uu_fold);
uucore::bin!(uu_fold);

View file

@ -17,11 +17,7 @@ path = "src/groups.rs"
[dependencies]
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["entries", "process"] }
uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" }
[[bin]]
name = "groups"
path = "src/main.rs"
[package.metadata.cargo-udeps.ignore]
normal = ["uucore_procs"]

View file

@ -69,7 +69,7 @@ fn infallible_gid2grp(gid: &u32) -> String {
}
}
#[uucore_procs::gen_uumain]
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let usage = usage();

View file

@ -1 +1 @@
uucore_procs::main!(uu_groups);
uucore::bin!(uu_groups);

View file

@ -28,11 +28,7 @@ sha2 = "0.6.0"
sha3 = "0.6.0"
blake2b_simd = "0.5.11"
uucore = { version=">=0.0.11", package="uucore", path="../../uucore" }
uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" }
[[bin]]
name = "hashsum"
path = "src/main.rs"
[package.metadata.cargo-udeps.ignore]
normal = ["uucore_procs"]

View file

@ -274,7 +274,7 @@ fn is_valid_bit_num(arg: &str) -> Result<(), String> {
parse_bit_num(arg).map(|_| ()).map_err(|e| format!("{}", e))
}
#[uucore_procs::gen_uumain]
#[uucore::main]
pub fn uumain(mut args: impl uucore::Args) -> UResult<()> {
// if there is no program name for some reason, default to "hashsum"
let program = args.next().unwrap_or_else(|| OsString::from(NAME));

View file

@ -1 +1 @@
uucore_procs::main!(uu_hashsum);
uucore::bin!(uu_hashsum);

View file

@ -18,11 +18,7 @@ path = "src/head.rs"
clap = { version = "3.0", features = ["wrap_help", "cargo"] }
memchr = "2"
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["ringbuffer"] }
uucore_procs = { version=">=0.0.8", package="uucore_procs", path="../../uucore_procs" }
[[bin]]
name = "head"
path = "src/main.rs"
[package.metadata.cargo-udeps.ignore]
normal = ["uucore_procs"]

View file

@ -485,7 +485,7 @@ fn uu_head(options: &HeadOptions) -> UResult<()> {
Ok(())
}
#[uucore_procs::gen_uumain]
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let args = match HeadOptions::get_from(args) {
Ok(o) => o,

View file

@ -1 +1 @@
uucore_procs::main!(uu_head);
uucore::bin!(uu_head);

Some files were not shown because too many files have changed in this diff Show more