mirror of
https://github.com/uutils/coreutils
synced 2024-12-14 15:22:38 +00:00
commit
91660b88ff
4 changed files with 21 additions and 21 deletions
|
@ -10,5 +10,5 @@
|
|||
*/
|
||||
|
||||
pub fn uumain(_: Vec<String>) -> int {
|
||||
1
|
||||
1
|
||||
}
|
||||
|
|
|
@ -66,13 +66,13 @@ fn sysv_sum(mut reader: Box<Reader>) -> (uint, u16) {
|
|||
}
|
||||
|
||||
fn open(name: &str) -> IoResult<Box<Reader>> {
|
||||
match name {
|
||||
"-" => Ok(box stdin_raw() as Box<Reader>),
|
||||
_ => {
|
||||
let f = try!(File::open(&Path::new(name)));
|
||||
Ok(box f as Box<Reader>)
|
||||
}
|
||||
}
|
||||
match name {
|
||||
"-" => Ok(box stdin_raw() as Box<Reader>),
|
||||
_ => {
|
||||
let f = try!(File::open(&Path::new(name)));
|
||||
Ok(box f as Box<Reader>)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn uumain(args: Vec<String>) -> int {
|
||||
|
|
|
@ -10,5 +10,5 @@
|
|||
*/
|
||||
|
||||
pub fn uumain(_: Vec<String>) -> int {
|
||||
0
|
||||
0
|
||||
}
|
||||
|
|
|
@ -62,20 +62,20 @@ pub fn uumain(args: Vec<String>) -> int {
|
|||
print!("
|
||||
SIZE is an integer with an optional prefix and optional unit.
|
||||
The available units (K, M, G, T, P, E, Z, and Y) use the following format:
|
||||
'KB' => 1000 (kilobytes)
|
||||
'K' => 1024 (kibibytes)
|
||||
'MB' => 1000*1000 (megabytes)
|
||||
'M' => 1024*1024 (mebibytes)
|
||||
'GB' => 1000*1000*1000 (gigabytes)
|
||||
'G' => 1024*1024*1024 (gibibytes)
|
||||
'KB' => 1000 (kilobytes)
|
||||
'K' => 1024 (kibibytes)
|
||||
'MB' => 1000*1000 (megabytes)
|
||||
'M' => 1024*1024 (mebibytes)
|
||||
'GB' => 1000*1000*1000 (gigabytes)
|
||||
'G' => 1024*1024*1024 (gibibytes)
|
||||
SIZE may also be prefixed by one of the following to adjust the size of each
|
||||
file based on its current size:
|
||||
'+' => extend by
|
||||
'-' => reduce by
|
||||
'<' => at most
|
||||
'>' => at least
|
||||
'/' => round down to multiple of
|
||||
'%' => round up to multiple of
|
||||
'+' => extend by
|
||||
'-' => reduce by
|
||||
'<' => at most
|
||||
'>' => at least
|
||||
'/' => round down to multiple of
|
||||
'%' => round up to multiple of
|
||||
");
|
||||
} else if matches.opt_present("version") {
|
||||
println!("truncate 1.0.0");
|
||||
|
|
Loading…
Reference in a new issue