mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
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:
Generated
+1
-102
File diff suppressed because it is too large
Load Diff
@@ -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"]
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
uucore_procs::main!(uu_arch);
|
||||
uucore::bin!(uu_arch);
|
||||
|
||||
@@ -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"]
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -1 +1 @@
|
||||
uucore_procs::main!(uu_base32);
|
||||
uucore::bin!(uu_base32);
|
||||
|
||||
@@ -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"]
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -1 +1 @@
|
||||
uucore_procs::main!(uu_base64);
|
||||
uucore::bin!(uu_base64);
|
||||
|
||||
@@ -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"]
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1 +1 @@
|
||||
uucore_procs::main!(uu_basename);
|
||||
uucore::bin!(uu_basename);
|
||||
|
||||
@@ -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"]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1 +1 @@
|
||||
uucore_procs::main!(uu_basenc);
|
||||
uucore::bin!(uu_basenc);
|
||||
|
||||
@@ -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"]
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1 +1 @@
|
||||
uucore_procs::main!(uu_cat);
|
||||
uucore::bin!(uu_cat);
|
||||
|
||||
@@ -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"]
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user