mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 04:27:45 +00:00
Merge pull request #334 from Arcterus/uutils-prefix
Improvements related to uutils
This commit is contained in:
commit
acef6419c3
2 changed files with 4 additions and 7 deletions
|
@ -22,8 +22,8 @@ fn main() {
|
||||||
}
|
}
|
||||||
util_map.push_str(format!("map.insert(\"{}\", hashsum::uumain);\n", prog).as_slice());
|
util_map.push_str(format!("map.insert(\"{}\", hashsum::uumain);\n", prog).as_slice());
|
||||||
}
|
}
|
||||||
"true" => util_map.push_str("map.insert(\"true\", uutrue);\n"),
|
"true" => util_map.push_str("fn uutrue(_: Vec<String>) -> int { 0 }\nmap.insert(\"true\", uutrue);\n"),
|
||||||
"false" => util_map.push_str("map.insert(\"false\", uufalse);\n"),
|
"false" => util_map.push_str("fn uufalse(_: Vec<String>) -> int { 1 }\nmap.insert(\"false\", uufalse);\n"),
|
||||||
"sync" => {
|
"sync" => {
|
||||||
crates.push_str("extern crate uusync;\n");
|
crates.push_str("extern crate uusync;\n");
|
||||||
util_map.push_str("map.insert(\"sync\", uusync::uumain);\n");
|
util_map.push_str("map.insert(\"sync\", uusync::uumain);\n");
|
||||||
|
|
|
@ -20,9 +20,6 @@ static NAME: &'static str = "uutils";
|
||||||
static VERSION: &'static str = "1.0.0";
|
static VERSION: &'static str = "1.0.0";
|
||||||
|
|
||||||
fn util_map() -> HashMap<&'static str, fn(Vec<String>) -> int> {
|
fn util_map() -> HashMap<&'static str, fn(Vec<String>) -> int> {
|
||||||
fn uutrue(_: Vec<String>) -> int { 0 }
|
|
||||||
fn uufalse(_: Vec<String>) -> int { 1 }
|
|
||||||
|
|
||||||
let mut map = HashMap::new();
|
let mut map = HashMap::new();
|
||||||
@UTIL_MAP@
|
@UTIL_MAP@
|
||||||
map
|
map
|
||||||
|
@ -58,8 +55,8 @@ fn main() {
|
||||||
None => (),
|
None => (),
|
||||||
}
|
}
|
||||||
|
|
||||||
if binary_as_util.starts_with("uutils")
|
if binary_as_util.ends_with("uutils")
|
||||||
|| binary_as_util.starts_with("busybox") {
|
|| binary_as_util.ends_with("busybox") {
|
||||||
// uutils can be called as either "uutils", "busybox"
|
// uutils can be called as either "uutils", "busybox"
|
||||||
// "uutils-suffix" or "busybox-suffix". Not sure
|
// "uutils-suffix" or "busybox-suffix". Not sure
|
||||||
// what busybox uses the -suffix pattern for.
|
// what busybox uses the -suffix pattern for.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue