diff --git a/base64/base64.rs b/base64/base64.rs index 658b7d665..70b84ad13 100644 --- a/base64/base64.rs +++ b/base64/base64.rs @@ -12,7 +12,7 @@ extern mod extra; use std::char; -use std::io::{File, stdin, stdout}; +use std::io::{println, File, stdin, stdout}; use std::os; use std::str; @@ -135,7 +135,7 @@ fn encode(input: &mut Reader, line_wrap: uint) { fn help(progname: &str, usage: &str) { println!("Usage: {:s} [OPTION]... [FILE]", progname); - println(""); + println!(""); println(usage); let msg = ~"With no FILE, or when FILE is -, read standard input.\n\n\ @@ -149,7 +149,7 @@ fn help(progname: &str, usage: &str) { } fn version() { - println("base64 1.0.0"); + println!("base64 1.0.0"); } enum Mode { diff --git a/basename/basename.rs b/basename/basename.rs index 59ead9171..7f6540ec3 100644 --- a/basename/basename.rs +++ b/basename/basename.rs @@ -11,7 +11,7 @@ extern mod extra; -use std::io::stderr; +use std::io::{print, println, stderr}; use std::os; use std::str; use std::str::StrSlice; @@ -46,8 +46,8 @@ fn main() { if matches.opt_present("help") { println!("Usage: {0:s} NAME [SUFFIX]", program); println!(" or: {0:s} OPTION", program); - println("Print NAME with any leading directory components removed."); - println("If specified, also remove a trailing SUFFIX."); + println!("Print NAME with any leading directory components removed."); + println!("If specified, also remove a trailing SUFFIX."); print(groups::usage("", opts)); diff --git a/cat/cat.rs b/cat/cat.rs index 1a20937a0..a53693b25 100644 --- a/cat/cat.rs +++ b/cat/cat.rs @@ -15,7 +15,7 @@ extern mod extra; use std::os; -use std::io::{stdin, stderr, stdout, File, result}; +use std::io::{print, stdin, stderr, stdout, File, result}; use extra::getopts::groups; fn main() { @@ -44,18 +44,18 @@ fn main() { } }; if matches.opt_present("help") { - println("cat 1.0.0"); - println(""); - println("Usage:"); + println!("cat 1.0.0"); + println!(""); + println!("Usage:"); println!(" {0:s} [OPTION]... [FILE]...", program); - println(""); + println!(""); print(groups::usage("Concatenate FILE(s), or standard input, to standard output.", opts)); - println(""); - println("With no FILE, or when FILE is -, read standard input."); + println!(""); + println!("With no FILE, or when FILE is -, read standard input."); return; } if matches.opt_present("version") { - println("cat 1.0.0"); + println!("cat 1.0.0"); return; } diff --git a/dirname/dirname.rs b/dirname/dirname.rs index 8a8089d1e..3dd37c4b8 100644 --- a/dirname/dirname.rs +++ b/dirname/dirname.rs @@ -12,7 +12,7 @@ extern mod extra; use std::os; -use std::io::stderr; +use std::io::{print, stderr}; use extra::getopts::groups; static VERSION: &'static str = "1.0.0"; @@ -37,11 +37,11 @@ fn main() { }; if matches.opt_present("help") { - println("dirname " + VERSION + " - strip last component from file name"); - println(""); - println("Usage:"); + println!("dirname {:s} - strip last component from file name", VERSION); + println!(""); + println!("Usage:"); println!(" {0:s} [OPTION] NAME...", program); - println(""); + println!(""); print(groups::usage("Output each NAME with its last non-slash component and trailing slashes removed; if NAME contains no /'s, output '.' (meaning the current directory).", opts)); @@ -49,7 +49,7 @@ directory).", opts)); } if matches.opt_present("version") { - return println("dirname version: " + VERSION); + return println!("dirname version: {:s}", VERSION); } let separator = match matches.opt_present("zero") { diff --git a/echo/echo.rs b/echo/echo.rs index ddc05ebae..a1fbfafc7 100644 --- a/echo/echo.rs +++ b/echo/echo.rs @@ -12,7 +12,7 @@ extern mod extra; use std::os; -use std::io::stderr; +use std::io::{print, println, stderr}; use std::uint; use extra::getopts::groups; @@ -86,12 +86,12 @@ fn main() { }; if matches.opt_present("help") { - println("echo " + VERSION + " - display a line of text"); - println(""); - println("Usage:"); + println!("echo {:s} - display a line of text", VERSION); + println!(""); + println!("Usage:"); println!(" {0:s} [SHORT-OPTION]... [STRING]...", program); println!(" {0:s} LONG-OPTION", program); - println(""); + println!(""); println(groups::usage("Echo the STRING(s) to standard output.", opts)); println("If -e is in effect, the following sequences are recognized: @@ -111,7 +111,7 @@ fn main() { } if matches.opt_present("version") { - return println("echo version: " + VERSION); + return println!("echo version: {:s}", VERSION); } if !matches.free.is_empty() { @@ -181,6 +181,6 @@ fn main() { } if !matches.opt_present("n") { - println("") + println!("") } } diff --git a/printenv/printenv.rs b/printenv/printenv.rs index f20e532b1..4b9614d54 100644 --- a/printenv/printenv.rs +++ b/printenv/printenv.rs @@ -14,7 +14,7 @@ extern mod extra; use std::os; -use std::io::stderr; +use std::io::{print, stderr}; use extra::getopts::groups; fn main() { @@ -35,16 +35,16 @@ fn main() { } }; if matches.opt_present("help") { - println("printenv 1.0.0"); - println(""); - println("Usage:"); + println!("printenv 1.0.0"); + println!(""); + println!("Usage:"); println!(" {0:s} [VARIABLE]... [OPTION]...", program); - println(""); + println!(""); print(groups::usage("Prints the given environment VARIABLE(s), otherwise prints them all.", opts)); return; } if matches.opt_present("version") { - println("printenv 1.0.0"); + println!("printenv 1.0.0"); return; } let mut separator = "\n"; diff --git a/pwd/pwd.rs b/pwd/pwd.rs index 188ab72fd..e17010919 100644 --- a/pwd/pwd.rs +++ b/pwd/pwd.rs @@ -12,7 +12,7 @@ extern mod extra; use std::os; -use std::io::stderr; +use std::io::{print, stderr}; use extra::getopts::groups; static VERSION: &'static str = "1.0.0"; @@ -37,13 +37,13 @@ fn main() { if matches.opt_present("help") { println!("pwd {}", VERSION); - println(""); - println("Usage:"); + println!(""); + println!("Usage:"); println!(" {0:s} [OPTION] NAME...", program); - println(""); + println!(""); print(groups::usage("Print the full filename of the current working directory.", opts)); } else if matches.opt_present("version") { - return println("pwd version: " + VERSION); + return println!("pwd version: {}", VERSION); } else { let cwd = std::os::getcwd(); println!("{}", cwd.display()); diff --git a/rm/rm.rs b/rm/rm.rs index a42b42bd1..e1b03666e 100644 --- a/rm/rm.rs +++ b/rm/rm.rs @@ -12,7 +12,7 @@ extern mod extra; use std::os; -use std::io::{stdin,stderr,stdio,fs,buffered,io_error}; +use std::io::{print,stdin,stderr,stdio,fs,buffered,io_error}; use extra::getopts::groups; enum InteractiveMode { @@ -65,27 +65,27 @@ fn main() { } }; if matches.opt_present("help") { - println("rm 1.0.0"); - println(""); - println("Usage:"); + println!("rm 1.0.0"); + println!(""); + println!("Usage:"); println!(" {0:s} [OPTION]... [FILE]...", program); - println(""); + println!(""); print(groups::usage("Remove (unlink) the FILE(s).", opts)); - println(""); - println("By default, rm does not remove directories. Use the --recursive (-r)"); - println("option to remove each listed directory, too, along with all of its contents"); - println(""); - println("To remove a file whose name starts with a '-', for example '-foo',"); - println("use one of these commands:"); - println("rm -- -foo"); - println(""); - println("rm ./-foo"); - println(""); - println("Note that if you use rm to remove a file, it might be possible to recover"); - println("some of its contents, given sufficient expertise and/or time. For greater"); - println("assurance that the contents are truly unrecoverable, consider using shred."); + println!(""); + println!("By default, rm does not remove directories. Use the --recursive (-r)"); + println!("option to remove each listed directory, too, along with all of its contents"); + println!(""); + println!("To remove a file whose name starts with a '-', for example '-foo',"); + println!("use one of these commands:"); + println!("rm -- -foo"); + println!(""); + println!("rm ./-foo"); + println!(""); + println!("Note that if you use rm to remove a file, it might be possible to recover"); + println!("some of its contents, given sufficient expertise and/or time. For greater"); + println!("assurance that the contents are truly unrecoverable, consider using shred."); } else if matches.opt_present("version") { - println("rm 1.0.0"); + println!("rm 1.0.0"); } else if matches.free.is_empty() { writeln!(&mut stderr() as &mut Writer, "Missing an argument"); writeln!(&mut stderr() as &mut Writer, @@ -231,7 +231,7 @@ fn read_prompt() -> bool { 'y' | 'Y' => true, 'n' | 'N' => false, _ => { - print("Please enter either Y or N: "); + print!("Please enter either Y or N: "); read_prompt() } } diff --git a/rmdir/rmdir.rs b/rmdir/rmdir.rs index d2e3f17dc..e2c122287 100644 --- a/rmdir/rmdir.rs +++ b/rmdir/rmdir.rs @@ -12,7 +12,7 @@ extern mod extra; use std::os; -use std::io::{stderr, io_error, fs}; +use std::io::{print, stderr, io_error, fs}; use extra::getopts::groups; fn main() { @@ -36,14 +36,14 @@ fn main() { }; if matches.opt_present("help") { - println("rmdir 1.0.0"); - println(""); - println("Usage:"); + println!("rmdir 1.0.0"); + println!(""); + println!("Usage:"); println!(" {0:s} [OPTION]... DIRECTORY...", program); - println(""); + println!(""); print(groups::usage("Remove the DIRECTORY(ies), if they are empty.", opts)); } else if matches.opt_present("version") { - println("rmdir 1.0.0"); + println!("rmdir 1.0.0"); } else if matches.free.is_empty() { writeln!(&mut stderr() as &mut Writer, "Missing an argument"); writeln!(&mut stderr() as &mut Writer, diff --git a/sleep/sleep.rs b/sleep/sleep.rs index a7f997bff..3665f10d6 100644 --- a/sleep/sleep.rs +++ b/sleep/sleep.rs @@ -14,7 +14,7 @@ extern mod extra; use std::num; use std::cast; use std::os; -use std::io::{stderr, timer}; +use std::io::{print, stderr, timer}; use extra::getopts::groups; fn main() { @@ -35,20 +35,20 @@ fn main() { }; if matches.opt_present("help") { - println("sleep 1.0.0"); - println(""); - println("Usage:"); + println!("sleep 1.0.0"); + println!(""); + println!("Usage:"); println!(" {0:s} NUMBER[SUFFIX]", program); - println("or"); + println!("or"); println!(" {0:s} OPTION", program); - println(""); + println!(""); print(groups::usage("Pause for NUMBER seconds. SUFFIX may be 's' for seconds (the default), 'm' for minutes, 'h' for hours or 'd' for days. Unlike most implementations that require NUMBER be an integer, here NUMBER may be an arbitrary floating point number. Given two or more arguments, pause for the amount of time specified by the sum of their values.", opts)); } else if matches.opt_present("version") { - println("sleep 1.0.0"); + println!("sleep 1.0.0"); } else if matches.free.is_empty() { writeln!(&mut stderr() as &mut Writer, "Missing an argument"); writeln!(&mut stderr() as &mut Writer, diff --git a/tee/tee.rs b/tee/tee.rs index 9242ec061..920bb7a80 100644 --- a/tee/tee.rs +++ b/tee/tee.rs @@ -12,7 +12,7 @@ extern mod extra; -use std::io::{stdin, stdout, Append, File, Truncate, Write}; +use std::io::{println, stdin, stdout, Append, File, Truncate, Write}; use std::io::{io_error, EndOfFile}; use std::io::signal::{Interrupt, Listener}; use std::io::util::{copy, NullWriter, MultiWriter}; diff --git a/tty/tty.rs b/tty/tty.rs index 150178a0c..c04dc9c2a 100644 --- a/tty/tty.rs +++ b/tty/tty.rs @@ -15,6 +15,7 @@ extern mod extra; use std::{libc,str,os}; +use std::io::println; use std::io::stdio::stderr; use extra::getopts::{optflag,getopts}; @@ -47,7 +48,7 @@ fn main () { if !tty.is_whitespace() { println(tty); } else { - println("not a tty"); + println!("not a tty"); } } diff --git a/wc/wc.rs b/wc/wc.rs index 7595afe66..d4fb626ac 100644 --- a/wc/wc.rs +++ b/wc/wc.rs @@ -12,7 +12,7 @@ extern mod extra; use std::os; -use std::io::{stdin, stderr, File, result}; +use std::io::{print, stdin, stderr, File, result}; use std::io::buffered::BufferedReader; use std::str::from_utf8_opt; use extra::getopts::{groups, Matches}; @@ -50,17 +50,17 @@ fn main() { }; if matches.opt_present("help") { - println("Usage:"); + println!("Usage:"); println!(" {0:s} [OPTION]... [FILE]...", program); - println(""); + println!(""); print(groups::usage("Print newline, word and byte counts for each FILE", opts)); - println(""); - println("With no FILE, or when FILE is -, read standard input."); + println!(""); + println!("With no FILE, or when FILE is -, read standard input."); return; } if (matches.opt_present("version")) { - println("wc 1.0.0"); + println!("wc 1.0.0"); return; } @@ -211,7 +211,7 @@ fn print_stats(filename: &~str, line_count: uint, word_count: uint, char_count: println!(" {}", *filename); } else { - println(""); + println!(""); } } diff --git a/whoami/whoami.rs b/whoami/whoami.rs index bb3840ef0..520ef0f89 100644 --- a/whoami/whoami.rs +++ b/whoami/whoami.rs @@ -13,6 +13,7 @@ extern mod extra; +use std::io::print; use std::os; use std::str; use std::libc; @@ -49,16 +50,16 @@ fn main() { Err(f) => fail!(f.to_err_msg()), }; if matches.opt_present("help") { - println("whoami 1.0.0"); - println(""); - println("Usage:"); + println!("whoami 1.0.0"); + println!(""); + println!("Usage:"); println!(" {:s}", program); - println(""); + println!(""); print(groups::usage("print effective userid", opts)); return; } if matches.opt_present("version") { - println("whoami 1.0.0"); + println!("whoami 1.0.0"); return; } diff --git a/yes/yes.rs b/yes/yes.rs index 17732eb21..02dfbddc7 100644 --- a/yes/yes.rs +++ b/yes/yes.rs @@ -14,7 +14,7 @@ extern mod extra; use std::os; -use std::io::stderr; +use std::io::{print, println, stderr}; use extra::getopts::groups; fn main() { @@ -34,16 +34,16 @@ fn main() { } }; if matches.opt_present("help") { - println("yes 1.0.0"); - println(""); - println("Usage:"); + println!("yes 1.0.0"); + println!(""); + println!("Usage:"); println!(" {0:s} [STRING]... [OPTION]...", program); - println(""); + println!(""); print(groups::usage("Repeatedly output a line with all specified STRING(s), or 'y'.", opts)); return; } if matches.opt_present("version") { - println("yes 1.0.0"); + println!("yes 1.0.0"); return; } let mut string = ~"y";