mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
uutils: auto-generate true and false
This commit is contained in:
+2
-2
@@ -22,8 +22,8 @@ fn main() {
|
||||
}
|
||||
util_map.push_str(format!("map.insert(\"{}\", hashsum::uumain);\n", prog).as_slice());
|
||||
}
|
||||
"true" => util_map.push_str("map.insert(\"true\", uutrue);\n"),
|
||||
"false" => util_map.push_str("map.insert(\"false\", uufalse);\n"),
|
||||
"true" => util_map.push_str("fn uutrue(_: Vec<String>) -> int { 0 }\nmap.insert(\"true\", uutrue);\n"),
|
||||
"false" => util_map.push_str("fn uufalse(_: Vec<String>) -> int { 1 }\nmap.insert(\"false\", uufalse);\n"),
|
||||
"sync" => {
|
||||
crates.push_str("extern crate uusync;\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";
|
||||
|
||||
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();
|
||||
@UTIL_MAP@
|
||||
map
|
||||
|
||||
Reference in New Issue
Block a user