mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-31 04:57:45 +00:00
uucore: make features opt-in rather than opt-out
This commit is contained in:
parent
7b1554cc2c
commit
bd557c87fb
37 changed files with 71 additions and 56 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -1882,7 +1882,7 @@ name = "whoami"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"advapi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"advapi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
"clap 2.31.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"uucore 0.0.1",
|
"uucore 0.0.1",
|
||||||
"winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
|
@ -10,10 +10,7 @@ path = "arch.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
platform-info = { git = "https://github.com/uutils/platform-info" }
|
platform-info = { git = "https://github.com/uutils/platform-info" }
|
||||||
|
uucore = { path = "../uucore" }
|
||||||
[dependencies.uucore]
|
|
||||||
path = "../uucore"
|
|
||||||
default-features = false
|
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "arch"
|
name = "arch"
|
||||||
|
|
|
@ -8,8 +8,9 @@ build = "../../mkmain.rs"
|
||||||
name = "uu_base32"
|
name = "uu_base32"
|
||||||
path = "base32.rs"
|
path = "base32.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies.uucore]
|
||||||
uucore = { path="../uucore" }
|
path = "../uucore"
|
||||||
|
features = ["encoding"]
|
||||||
|
|
||||||
[dependencies.clippy]
|
[dependencies.clippy]
|
||||||
version = "0.0.143"
|
version = "0.0.143"
|
||||||
|
|
|
@ -8,8 +8,9 @@ build = "../../mkmain.rs"
|
||||||
name = "uu_base64"
|
name = "uu_base64"
|
||||||
path = "base64.rs"
|
path = "base64.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies.uucore]
|
||||||
uucore = { path="../uucore" }
|
path = "../uucore"
|
||||||
|
features = ["encoding"]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "base64"
|
name = "base64"
|
||||||
|
|
|
@ -10,7 +10,10 @@ path = "cat.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
quick-error = "1.1.0"
|
quick-error = "1.1.0"
|
||||||
uucore = { path="../uucore" }
|
|
||||||
|
[dependencies.uucore]
|
||||||
|
path = "../uucore"
|
||||||
|
features = ["fs"]
|
||||||
|
|
||||||
[target.'cfg(unix)'.dependencies]
|
[target.'cfg(unix)'.dependencies]
|
||||||
unix_socket = "0.5.0"
|
unix_socket = "0.5.0"
|
||||||
|
|
|
@ -13,7 +13,6 @@ walkdir = "1.0.7"
|
||||||
|
|
||||||
[dependencies.uucore]
|
[dependencies.uucore]
|
||||||
path = "../uucore"
|
path = "../uucore"
|
||||||
default-features = false
|
|
||||||
features = ["entries", "fs"]
|
features = ["entries", "fs"]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
|
|
|
@ -10,9 +10,12 @@ path = "chmod.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
libc = "0.2.26"
|
libc = "0.2.26"
|
||||||
uucore = { path="../uucore" }
|
|
||||||
walker = "1.0.0"
|
walker = "1.0.0"
|
||||||
|
|
||||||
|
[dependencies.uucore]
|
||||||
|
path = "../uucore"
|
||||||
|
features = ["mode"]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "chmod"
|
name = "chmod"
|
||||||
path = "../../uumain.rs"
|
path = "../../uumain.rs"
|
||||||
|
|
|
@ -14,7 +14,6 @@ walkdir = "0.1"
|
||||||
|
|
||||||
[dependencies.uucore]
|
[dependencies.uucore]
|
||||||
path = "../uucore"
|
path = "../uucore"
|
||||||
default-features = false
|
|
||||||
features = ["entries", "fs"]
|
features = ["entries", "fs"]
|
||||||
|
|
||||||
[dependencies.clippy]
|
[dependencies.clippy]
|
||||||
|
|
|
@ -13,7 +13,6 @@ getopts = "0.2.14"
|
||||||
|
|
||||||
[dependencies.uucore]
|
[dependencies.uucore]
|
||||||
path = "../uucore"
|
path = "../uucore"
|
||||||
default-features = false
|
|
||||||
features = ["entries"]
|
features = ["entries"]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
|
|
|
@ -17,9 +17,12 @@ libc = "0.2.26"
|
||||||
walkdir = "1.0.7"
|
walkdir = "1.0.7"
|
||||||
clap = "2.20.0"
|
clap = "2.20.0"
|
||||||
quick-error = "1.1.0"
|
quick-error = "1.1.0"
|
||||||
uucore = { path="../uucore" }
|
|
||||||
filetime = "0.1"
|
filetime = "0.1"
|
||||||
|
|
||||||
|
[dependencies.uucore]
|
||||||
|
path = "../uucore"
|
||||||
|
features = ["fs"]
|
||||||
|
|
||||||
[target.'cfg(target_os = "linux")'.dependencies]
|
[target.'cfg(target_os = "linux")'.dependencies]
|
||||||
ioctl-sys = "0.5.2"
|
ioctl-sys = "0.5.2"
|
||||||
|
|
||||||
|
|
5
src/env/env.rs
vendored
5
src/env/env.rs
vendored
|
@ -9,7 +9,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* last synced with: env (GNU coreutils) 8.13 */
|
/* last synced with: env (GNU coreutils) 8.13 */
|
||||||
#![allow(non_camel_case_types)]
|
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate uucore;
|
extern crate uucore;
|
||||||
|
@ -25,7 +24,7 @@ static LONG_HELP: &'static str = "
|
||||||
A mere - implies -i. If no COMMAND, print the resulting environment
|
A mere - implies -i. If no COMMAND, print the resulting environment
|
||||||
";
|
";
|
||||||
|
|
||||||
struct options {
|
struct Options {
|
||||||
ignore_env: bool,
|
ignore_env: bool,
|
||||||
null: bool,
|
null: bool,
|
||||||
unsets: Vec<String>,
|
unsets: Vec<String>,
|
||||||
|
@ -52,7 +51,7 @@ pub fn uumain(args: Vec<String>) -> i32 {
|
||||||
)
|
)
|
||||||
.optopt("u", "unset", "remove variable from the environment", "NAME");
|
.optopt("u", "unset", "remove variable from the environment", "NAME");
|
||||||
|
|
||||||
let mut opts = Box::new(options {
|
let mut opts = Box::new(Options {
|
||||||
ignore_env: false,
|
ignore_env: false,
|
||||||
null: false,
|
null: false,
|
||||||
unsets: vec![],
|
unsets: vec![],
|
||||||
|
|
|
@ -10,7 +10,6 @@ path = "groups.rs"
|
||||||
|
|
||||||
[dependencies.uucore]
|
[dependencies.uucore]
|
||||||
path = "../uucore"
|
path = "../uucore"
|
||||||
default-features = false
|
|
||||||
features = ["entries"]
|
features = ["entries"]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
|
|
|
@ -10,7 +10,6 @@ path = "id.rs"
|
||||||
|
|
||||||
[dependencies.uucore]
|
[dependencies.uucore]
|
||||||
path = "../uucore"
|
path = "../uucore"
|
||||||
default-features = false
|
|
||||||
features = ["entries", "process"]
|
features = ["entries", "process"]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
|
|
|
@ -10,7 +10,10 @@ path = "kill.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
libc = "0.2.26"
|
libc = "0.2.26"
|
||||||
uucore = { path="../uucore" }
|
|
||||||
|
[dependencies.uucore]
|
||||||
|
path = "../uucore"
|
||||||
|
features = ["signals"]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "kill"
|
name = "kill"
|
||||||
|
|
|
@ -19,7 +19,6 @@ unicode-width = "0.1.4"
|
||||||
|
|
||||||
[dependencies.uucore]
|
[dependencies.uucore]
|
||||||
path = "../uucore"
|
path = "../uucore"
|
||||||
default-features = false
|
|
||||||
features = ["entries"]
|
features = ["entries"]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
|
|
|
@ -11,7 +11,10 @@ path = "nohup.rs"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
getopts = "0.2.14"
|
getopts = "0.2.14"
|
||||||
libc = "0.2.26"
|
libc = "0.2.26"
|
||||||
uucore = { path="../uucore" }
|
|
||||||
|
[dependencies.uucore]
|
||||||
|
path = "../uucore"
|
||||||
|
features = ["fs"]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "nohup"
|
name = "nohup"
|
||||||
|
|
|
@ -10,7 +10,6 @@ path = "pinky.rs"
|
||||||
|
|
||||||
[dependencies.uucore]
|
[dependencies.uucore]
|
||||||
path = "../uucore"
|
path = "../uucore"
|
||||||
default-features = false
|
|
||||||
features = ["utmpx", "entries"]
|
features = ["utmpx", "entries"]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
|
|
|
@ -11,7 +11,10 @@ path = "readlink.rs"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
getopts = "0.2.14"
|
getopts = "0.2.14"
|
||||||
libc = "0.2.26"
|
libc = "0.2.26"
|
||||||
uucore = { path="../uucore" }
|
|
||||||
|
[dependencies.uucore]
|
||||||
|
path = "../uucore"
|
||||||
|
features = ["fs"]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "readlink"
|
name = "readlink"
|
||||||
|
|
|
@ -10,7 +10,10 @@ path = "realpath.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
getopts = "0.2.14"
|
getopts = "0.2.14"
|
||||||
uucore = { path="../uucore" }
|
|
||||||
|
[dependencies.uucore]
|
||||||
|
path = "../uucore"
|
||||||
|
features = ["fs"]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "realpath"
|
name = "realpath"
|
||||||
|
|
|
@ -10,7 +10,10 @@ path = "relpath.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
getopts = "0.2.14"
|
getopts = "0.2.14"
|
||||||
uucore = { path="../uucore" }
|
|
||||||
|
[dependencies.uucore]
|
||||||
|
path = "../uucore"
|
||||||
|
features = ["fs"]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "relpath"
|
name = "relpath"
|
||||||
|
|
|
@ -10,7 +10,10 @@ path = "sleep.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
getopts = "0.2.14"
|
getopts = "0.2.14"
|
||||||
uucore = { path="../uucore" }
|
|
||||||
|
[dependencies.uucore]
|
||||||
|
path = "../uucore"
|
||||||
|
features = ["parse_time"]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "sleep"
|
name = "sleep"
|
||||||
|
|
|
@ -12,7 +12,10 @@ path = "sort.rs"
|
||||||
getopts = "0.2.14"
|
getopts = "0.2.14"
|
||||||
semver = "0.7.0"
|
semver = "0.7.0"
|
||||||
itertools = "0.6.0"
|
itertools = "0.6.0"
|
||||||
uucore = { path="../uucore" }
|
|
||||||
|
[dependencies.uucore]
|
||||||
|
path = "../uucore"
|
||||||
|
features = ["fs"]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "sort"
|
name = "sort"
|
||||||
|
|
|
@ -14,7 +14,6 @@ time = "0.1.38"
|
||||||
|
|
||||||
[dependencies.uucore]
|
[dependencies.uucore]
|
||||||
path = "../uucore"
|
path = "../uucore"
|
||||||
default-features = false
|
|
||||||
features = ["entries"]
|
features = ["entries"]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
|
|
|
@ -13,7 +13,10 @@ getopts = "0.2.14"
|
||||||
libc = "0.2.26"
|
libc = "0.2.26"
|
||||||
winapi = { version = "0.3", features = ["handleapi", "winerror"] }
|
winapi = { version = "0.3", features = ["handleapi", "winerror"] }
|
||||||
kernel32-sys = "0.2.2"
|
kernel32-sys = "0.2.2"
|
||||||
uucore = { path="../uucore" }
|
|
||||||
|
[dependencies.uucore]
|
||||||
|
path = "../uucore"
|
||||||
|
features = ["wide"]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "sync"
|
name = "sync"
|
||||||
|
|
|
@ -12,7 +12,10 @@ path = "timeout.rs"
|
||||||
getopts = "0.2.14"
|
getopts = "0.2.14"
|
||||||
libc = "0.2.26"
|
libc = "0.2.26"
|
||||||
time = "0.1.38"
|
time = "0.1.38"
|
||||||
uucore = { path="../uucore" }
|
|
||||||
|
[dependencies.uucore]
|
||||||
|
path = "../uucore"
|
||||||
|
features = ["parse_time", "process"]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "timeout"
|
name = "timeout"
|
||||||
|
|
|
@ -15,7 +15,6 @@ time = "0.1.38"
|
||||||
|
|
||||||
[dependencies.uucore]
|
[dependencies.uucore]
|
||||||
path = "../uucore"
|
path = "../uucore"
|
||||||
default-features = false
|
|
||||||
features = ["libc"]
|
features = ["libc"]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
|
|
|
@ -12,10 +12,7 @@ path = "tr.rs"
|
||||||
getopts = "0.2.14"
|
getopts = "0.2.14"
|
||||||
bit-set = "0.4.0"
|
bit-set = "0.4.0"
|
||||||
fnv = "1.0.5"
|
fnv = "1.0.5"
|
||||||
|
uucore = { path = "../uucore" }
|
||||||
[dependencies.uucore]
|
|
||||||
path = "../uucore"
|
|
||||||
default-features = false
|
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "tr"
|
name = "tr"
|
||||||
|
|
|
@ -11,7 +11,10 @@ path = "tty.rs"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
getopts = "0.2.14"
|
getopts = "0.2.14"
|
||||||
libc = "0.2.26"
|
libc = "0.2.26"
|
||||||
uucore = { path="../uucore" }
|
|
||||||
|
[dependencies.uucore]
|
||||||
|
path = "../uucore"
|
||||||
|
features = ["fs"]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "tty"
|
name = "tty"
|
||||||
|
|
|
@ -11,10 +11,7 @@ path = "uname.rs"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = "2.20.0"
|
clap = "2.20.0"
|
||||||
platform-info = { git = "https://github.com/uutils/platform-info" }
|
platform-info = { git = "https://github.com/uutils/platform-info" }
|
||||||
|
uucore = { path = "../uucore" }
|
||||||
[dependencies.uucore]
|
|
||||||
path = "../uucore"
|
|
||||||
default-features = false
|
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "uname"
|
name = "uname"
|
||||||
|
|
|
@ -11,7 +11,10 @@ path = "unexpand.rs"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
getopts = "0.2.14"
|
getopts = "0.2.14"
|
||||||
unicode-width = "0.1.4"
|
unicode-width = "0.1.4"
|
||||||
uucore = { path="../uucore" }
|
|
||||||
|
[dependencies.uucore]
|
||||||
|
path = "../uucore"
|
||||||
|
features = ["utf8"]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "unexpand"
|
name = "unexpand"
|
||||||
|
|
|
@ -10,10 +10,7 @@ path = "uniq.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
getopts = "0.2.14"
|
getopts = "0.2.14"
|
||||||
|
uucore = { path = "../uucore" }
|
||||||
[dependencies.uucore]
|
|
||||||
path="../uucore"
|
|
||||||
default-features = false
|
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "uniq"
|
name = "uniq"
|
||||||
|
|
|
@ -13,7 +13,6 @@ getopts = "0.2.14"
|
||||||
|
|
||||||
[dependencies.uucore]
|
[dependencies.uucore]
|
||||||
path = "../uucore"
|
path = "../uucore"
|
||||||
default-features = false
|
|
||||||
features = ["utmpx"]
|
features = ["utmpx"]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
|
|
|
@ -12,7 +12,6 @@ path = "users.rs"
|
||||||
getopts = "0.2.14"
|
getopts = "0.2.14"
|
||||||
|
|
||||||
[dependencies.uucore]
|
[dependencies.uucore]
|
||||||
default-features = false
|
|
||||||
features = ["utmpx"]
|
features = ["utmpx"]
|
||||||
path = "../uucore"
|
path = "../uucore"
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ process = ["libc"]
|
||||||
signals = []
|
signals = []
|
||||||
entries = ["libc"]
|
entries = ["libc"]
|
||||||
wide = []
|
wide = []
|
||||||
default = ["fs", "libc", "utf8", "encoding", "parse_time", "mode", "utmpx", "process", "entries", "signals", "wide"]
|
default = []
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
path = "lib.rs"
|
path = "lib.rs"
|
||||||
|
|
|
@ -10,7 +10,6 @@ path = "who.rs"
|
||||||
|
|
||||||
[dependencies.uucore]
|
[dependencies.uucore]
|
||||||
path = "../uucore"
|
path = "../uucore"
|
||||||
default-features = false
|
|
||||||
features = ["utmpx"]
|
features = ["utmpx"]
|
||||||
|
|
||||||
[dependencies.clippy]
|
[dependencies.clippy]
|
||||||
|
|
|
@ -16,7 +16,6 @@ advapi32-sys = "0.2.0"
|
||||||
|
|
||||||
[dependencies.uucore]
|
[dependencies.uucore]
|
||||||
path = "../uucore"
|
path = "../uucore"
|
||||||
default-features = false
|
|
||||||
features = ["entries", "wide"]
|
features = ["entries", "wide"]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
|
|
|
@ -11,10 +11,7 @@ path = "yes.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = "2.31"
|
clap = "2.31"
|
||||||
|
uucore = { path = "../uucore" }
|
||||||
[dependencies.uucore]
|
|
||||||
path = "../uucore"
|
|
||||||
default-features = false
|
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "yes"
|
name = "yes"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue