mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
Remove the now unnecessary conversion of os::args() ret val.
This commit is contained in:
parent
0ce3f0f4e1
commit
46b9d6d78e
15 changed files with 17 additions and 17 deletions
|
@ -36,7 +36,7 @@ mod util;
|
|||
static NAME: &'static str = "base64";
|
||||
|
||||
fn main() {
|
||||
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
let opts = ~[
|
||||
optflag("d", "decode", "decode data"),
|
||||
optflag("i", "ignore-garbage", "when decoding, ignore non-alphabetic characters"),
|
||||
|
|
|
@ -20,7 +20,7 @@ use std::io::stdio::{stdout_raw, stdin_raw};
|
|||
use std::io::{BufferedWriter};
|
||||
|
||||
fn main() {
|
||||
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
let program = args.get(0).as_slice();
|
||||
let opts = ~[
|
||||
getopts::optflag("A", "show-all", "equivalent to -vET"),
|
||||
|
|
|
@ -78,7 +78,7 @@ fn open_file(name: &str) -> IoResult<Box<Reader>> {
|
|||
}
|
||||
|
||||
pub fn main() {
|
||||
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
let opts = [
|
||||
getopts::optflag("h", "help", "display this help and exit"),
|
||||
getopts::optflag("V", "version", "output version information and exit"),
|
||||
|
|
|
@ -88,7 +88,7 @@ fn open_file(name: &str) -> IoResult<Box<Buffer>> {
|
|||
}
|
||||
|
||||
pub fn main() {
|
||||
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
let opts = [
|
||||
getopts::optflag("1", "", "suppress column 1 (lines uniq to FILE1)"),
|
||||
getopts::optflag("2", "", "suppress column 2 (lines uniq to FILE2)"),
|
||||
|
|
2
cp/cp.rs
2
cp/cp.rs
|
@ -32,7 +32,7 @@ pub enum Mode {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
let opts = ~[
|
||||
optflag("h", "help", "display this help and exit"),
|
||||
optflag("", "version", "output version information and exit"),
|
||||
|
|
|
@ -17,7 +17,7 @@ use std::io::print;
|
|||
static VERSION: &'static str = "1.0.0";
|
||||
|
||||
fn main() {
|
||||
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
let program = args.get(0).clone();
|
||||
let opts = ~[
|
||||
getopts::optflag("z", "zero", "separate output with NUL rather than newline"),
|
||||
|
|
2
du/du.rs
2
du/du.rs
|
@ -91,7 +91,7 @@ fn du(path: &Path, mut my_stat: Stat,
|
|||
}
|
||||
|
||||
fn main() {
|
||||
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
let program = args.get(0).as_slice();
|
||||
let opts = ~[
|
||||
// In task
|
||||
|
|
|
@ -70,7 +70,7 @@ fn convert_str(string: &str, index: uint, base: uint) -> (char, int) {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
let program = args.get(0).clone();
|
||||
let opts = ~[
|
||||
getopts::optflag("n", "", "do not output the trailing newline"),
|
||||
|
|
|
@ -28,9 +28,9 @@ static VERSION: &'static str = "1.0.0";
|
|||
|
||||
fn main() {
|
||||
|
||||
let (args, obs_width) = handle_obsolete(os::args().as_slice().to_owned());
|
||||
let args = os::args();
|
||||
let (args, obs_width) = handle_obsolete(args.as_slice());
|
||||
let program = args.get(0).clone();
|
||||
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
|
||||
let opts = [
|
||||
getopts::optflag("b", "bytes", "count using bytes rather than columns (meaning control characters such as newline are not treated specially)"),
|
||||
|
|
|
@ -26,7 +26,7 @@ use c_types::{get_pw_from_args, group};
|
|||
static NAME: &'static str = "groups";
|
||||
|
||||
fn main () {
|
||||
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
let options = [
|
||||
optflag("h", "", "Help")
|
||||
];
|
||||
|
|
|
@ -31,7 +31,7 @@ fn main () {
|
|||
(args, None) => args
|
||||
};
|
||||
|
||||
let args: Vec<StrBuf> = options.iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = options;
|
||||
|
||||
let possible_options = [
|
||||
optopt("n", "number", "Number of lines to print", "n"),
|
||||
|
|
|
@ -24,8 +24,8 @@ extern {
|
|||
}
|
||||
|
||||
fn main () {
|
||||
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let program = args.get(0).to_owned();
|
||||
let args = os::args();
|
||||
let program = args.get(0);
|
||||
|
||||
let options = [
|
||||
optflag("f", "full", "Default option to show full name"),
|
||||
|
|
2
id/id.rs
2
id/id.rs
|
@ -88,7 +88,7 @@ extern {
|
|||
static NAME: &'static str = "id";
|
||||
|
||||
fn main () {
|
||||
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
let args_t = args.tail();
|
||||
|
||||
let options = [
|
||||
|
|
|
@ -54,7 +54,7 @@ pub enum Mode {
|
|||
|
||||
|
||||
fn main() {
|
||||
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
|
||||
let opts = ~[
|
||||
optflag("h", "help", "display this help and exit"),
|
||||
|
|
|
@ -44,7 +44,7 @@ fn version() {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
let program = args.get(0).clone();
|
||||
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue