mirror of
https://github.com/uutils/coreutils
synced 2024-09-06 07:54:05 +00:00
Update to use the new format! macro
This commit is contained in:
parent
6e6d4bf14b
commit
cdc435f008
|
@ -46,7 +46,7 @@ fn main() {
|
|||
println("cat 1.0.0");
|
||||
println("");
|
||||
println("Usage:");
|
||||
println(fmt!(" %s [OPTION]... [FILE]...", program));
|
||||
println(format!(" {0:s} [OPTION]... [FILE]...", program));
|
||||
println("");
|
||||
print(groups::usage("Concatenate FILE(s), or standard input, to standard output.", opts));
|
||||
println("");
|
||||
|
@ -116,7 +116,7 @@ pub fn exec(files: ~[~str], number: NumberingMode, show_nonprint: bool, show_end
|
|||
let buf = reader.read_bytes(2);
|
||||
for byte in buf.iter() {
|
||||
if at_line_start && (number == NumberAll || (number == NumberNonEmpty && !is_newline_char(*byte))) {
|
||||
writer.write_str(fmt!("%6u ", counter));
|
||||
writer.write_str(format!("{0:6u} ", counter));
|
||||
counter += 1;
|
||||
at_line_start = false;
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ fn open(path: ~str) -> Option<@Reader> {
|
|||
match std::io::file_reader(&std::path::Path::new(path.as_slice())) {
|
||||
Ok(fd) => return Some(fd),
|
||||
Err(e) => {
|
||||
stderr().write_line(fmt!("cat: %s: %s", path, e));
|
||||
stderr().write_line(format!("cat: {0:s}: {1:s}", path, e));
|
||||
os::set_exit_status(1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ fn main() {
|
|||
println("printenv 1.0.0");
|
||||
println("");
|
||||
println("Usage:");
|
||||
println(fmt!(" %s [VARIABLE]... [OPTION]...", program));
|
||||
println(format!(" {0:s} [VARIABLE]... [OPTION]...", program));
|
||||
println("");
|
||||
print(groups::usage("Prints the given environment VARIABLE(s), otherwise prints them all.", opts));
|
||||
return;
|
||||
|
@ -59,7 +59,7 @@ pub fn exec(args: ~[~str], separator: &str) {
|
|||
if args.is_empty() {
|
||||
let vars = os::env();
|
||||
for (env_var, value) in vars.move_iter() {
|
||||
print(fmt!("%s=%s", env_var, value));
|
||||
print(format!("{0:s}={1:s}", env_var, value));
|
||||
print(separator);
|
||||
}
|
||||
return;
|
||||
|
|
|
@ -37,7 +37,7 @@ fn main() {
|
|||
println("yes 1.0.0");
|
||||
println("");
|
||||
println("Usage:");
|
||||
println(fmt!(" %s [STRING]... [OPTION]...", program));
|
||||
println(format!(" {0:s} [STRING]... [OPTION]...", program));
|
||||
println("");
|
||||
print(groups::usage("Repeatedly output a line with all specified STRING(s), or 'y'.", opts));
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue