mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
Merge pull request #130 from alan-andrade/fix_master
Fix master by comparing against slices, not ~
This commit is contained in:
commit
a75e42d4db
4 changed files with 12 additions and 12 deletions
12
env/env.rs
vendored
12
env/env.rs
vendored
|
@ -92,13 +92,13 @@ fn main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if opt.starts_with("--") {
|
} else if opt.starts_with("--") {
|
||||||
match *opt {
|
match opt.as_slice() {
|
||||||
~"--help" => { usage(prog); return }
|
"--help" => { usage(prog); return }
|
||||||
~"--version" => { version(); return }
|
"--version" => { version(); return }
|
||||||
|
|
||||||
~"--ignore-environment" => opts.ignore_env = true,
|
"--ignore-environment" => opts.ignore_env = true,
|
||||||
~"--null" => opts.null = true,
|
"--null" => opts.null = true,
|
||||||
~"--unset" => {
|
"--unset" => {
|
||||||
let var = iter.next();
|
let var = iter.next();
|
||||||
|
|
||||||
match var {
|
match var {
|
||||||
|
|
|
@ -128,7 +128,7 @@ fn obsolete (options: &mut ~[~str]) -> Option<uint> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn head<T: Reader> (reader: &mut BufferedReader<T>, line_count:uint) {
|
fn head<T: Reader> (reader: &mut BufferedReader<T>, line_count:uint) {
|
||||||
for line in reader.lines().take(line_count) { print!("{:s}", line); }
|
for line in reader.lines().take(line_count) { print!("{}", line); }
|
||||||
}
|
}
|
||||||
|
|
||||||
fn version () {
|
fn version () {
|
||||||
|
|
8
rm/rm.rs
8
rm/rm.rs
|
@ -87,10 +87,10 @@ fn main() {
|
||||||
} else if matches.opt_present("I") {
|
} else if matches.opt_present("I") {
|
||||||
InteractiveOnce
|
InteractiveOnce
|
||||||
} else if matches.opt_present("interactive") {
|
} else if matches.opt_present("interactive") {
|
||||||
match matches.opt_str("interactive").unwrap() {
|
match matches.opt_str("interactive").unwrap().as_slice() {
|
||||||
~"none" => InteractiveNone,
|
"none" => InteractiveNone,
|
||||||
~"once" => InteractiveOnce,
|
"once" => InteractiveOnce,
|
||||||
~"always" => InteractiveAlways,
|
"always" => InteractiveAlways,
|
||||||
val => {
|
val => {
|
||||||
crash!(1, "Invalid argument to interactive ({})", val)
|
crash!(1, "Invalid argument to interactive ({})", val)
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,7 @@ fn sleep(args: &[~str]) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn match_suffix(arg: &mut ~str) -> Result<int, ~str> {
|
fn match_suffix(arg: &mut ~str) -> Result<int, ~str> {
|
||||||
let result = match (*arg).pop_char() {
|
let result = match (*arg).pop_char().unwrap() {
|
||||||
's' | 'S' => Ok(1),
|
's' | 'S' => Ok(1),
|
||||||
'm' | 'M' => Ok(60),
|
'm' | 'M' => Ok(60),
|
||||||
'h' | 'H' => Ok(60 * 60),
|
'h' | 'H' => Ok(60 * 60),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue