diff --git a/basename/basename.rs b/basename/basename.rs index 4d0194844..f46b6cdfe 100644 --- a/basename/basename.rs +++ b/basename/basename.rs @@ -62,13 +62,13 @@ pub fn uumain(args: Vec) -> int { if args.len() < 2 { println!("{}: {}", program, "missing operand"); println!("Try '{} --help' for more information.", program); - return 0; + return 1; } // too many arguments else if args.len() > 3 { println!("{}: extra operand '{}'", program, args.get(3)); println!("Try '{} --help' for more information.", program); - return 0; + return 1; } // diff --git a/dirname/dirname.rs b/dirname/dirname.rs index a4f23430b..faa5c74fd 100644 --- a/dirname/dirname.rs +++ b/dirname/dirname.rs @@ -66,6 +66,7 @@ directory).", opts).as_slice()); } else { println!("{0:s}: missing operand", program); println!("Try '{0:s} --help' for more information.", program); + return 1; } 0 diff --git a/env/env.rs b/env/env.rs index f2434974d..677833fd8 100644 --- a/env/env.rs +++ b/env/env.rs @@ -114,7 +114,7 @@ pub fn uumain(args: Vec) -> int { _ => { println!("{:s}: invalid option \"{:s}\"", prog, *opt); println!("Type \"{:s} --help\" for detailed informations", prog); - return 0; + return 1; } } } else if opt.as_slice().starts_with("-") { @@ -146,7 +146,7 @@ pub fn uumain(args: Vec) -> int { _ => { println!("{:s}: illegal option -- {:c}", prog, c); println!("Type \"{:s} --help\" for detailed informations", prog); - return 0; + return 1; } } } diff --git a/head/head.rs b/head/head.rs index 37adad266..670c988aa 100644 --- a/head/head.rs +++ b/head/head.rs @@ -46,7 +46,7 @@ pub fn uumain(args: Vec) -> int { Ok (m) => { m } Err(_) => { println!("{:s}", usage(PROGRAM, possible_options)); - return 0; + return 1; } }; diff --git a/id/id.rs b/id/id.rs index e75ba70a2..a3a4c01b9 100644 --- a/id/id.rs +++ b/id/id.rs @@ -105,7 +105,7 @@ pub fn uumain(args: Vec) -> int { Ok(m) => { m }, Err(_) => { println!("{:s}", usage(NAME, options)); - return 0; + return 1; } }; diff --git a/sync/sync.rs b/sync/sync.rs index 6b71538a9..cb14d69c0 100644 --- a/sync/sync.rs +++ b/sync/sync.rs @@ -33,7 +33,7 @@ pub fn uumain(args: Vec) -> int { let matches = match getopts(args.tail(), options) { Ok(m) => { m } - _ => { help(program.as_slice(), options); return 0 } + _ => { help(program.as_slice(), options); return 1 } }; if matches.opt_present("h") { diff --git a/touch/touch.rs b/touch/touch.rs index 6bad044cb..fe53c5821 100644 --- a/touch/touch.rs +++ b/touch/touch.rs @@ -59,6 +59,9 @@ pub fn uumain(args: Vec) -> int { println!(""); println!("{:s}", getopts::usage("Update the access and modification times of \ each FILE to the current time.", opts)); + if matches.free.is_empty() { + return 1; + } return 0; }