1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

remove remaining uses of ~[T]

This commit is contained in:
Michael Gehring 2014-05-30 10:35:54 +02:00
parent 4107b265ba
commit 448f4d6d70
28 changed files with 30 additions and 30 deletions

View file

@ -36,7 +36,7 @@ mod util;
static NAME: &'static str = "base64";
pub fn uumain(args: Vec<String>) {
let opts = ~[
let opts = [
optflag("d", "decode", "decode data"),
optflag("i", "ignore-garbage", "when decoding, ignore non-alphabetic characters"),
optopt("w", "wrap",

View file

@ -32,7 +32,7 @@ pub fn uumain(args: Vec<String>) {
//
// Argument parsing
//
let opts = ~[
let opts = [
getopts::optflag("h", "help", "display this help and exit"),
getopts::optflag("V", "version", "output version information and exit"),
];

View file

@ -35,7 +35,7 @@ pub enum Mode {
fn main() { uumain(os::args()); }
pub fn uumain(args: Vec<String>) {
let opts = ~[
let opts = [
optflag("h", "help", "display this help and exit"),
optflag("", "version", "output version information and exit"),
];

View file

@ -21,7 +21,7 @@ fn main() { uumain(os::args()); }
pub fn uumain(args: Vec<String>) {
let program = args.get(0).clone();
let opts = ~[
let opts = [
getopts::optflag("z", "zero", "separate output with NUL rather than newline"),
getopts::optflag("", "help", "display this help and exit"),
getopts::optflag("", "version", "output version information and exit"),

View file

@ -95,7 +95,7 @@ fn main() { uumain(os::args()); }
pub fn uumain(args: Vec<String>) {
let program = args.get(0).as_slice();
let opts = ~[
let opts = [
// In task
getopts::optflag("a", "all", " write counts for all files, not just directories"),
// In main

View file

@ -74,7 +74,7 @@ fn main() { uumain(os::args()); }
pub fn uumain(args: Vec<String>) {
let program = args.get(0).clone();
let opts = ~[
let opts = [
getopts::optflag("n", "", "do not output the trailing newline"),
getopts::optflag("e", "", "enable interpretation of backslash escapes"),
getopts::optflag("E", "", "disable interpretation of backslash escapes (default)"),

View file

@ -57,7 +57,7 @@ fn main() { uumain(os::args()); }
pub fn uumain(args: Vec<String>) {
let opts = ~[
let opts = [
optflag("h", "help", "display this help and exit"),
optflag("V", "version", "output version information and exit"),
optopt("s", "signal", "specify the <signal> to be sent", "SIGNAL"),

View file

@ -52,7 +52,7 @@ pub fn uumain(args: Vec<String>) {
//
// Argument parsing
//
let opts = ~[
let opts = [
getopts::optflag("h", "help", "display this help and exit"),
getopts::optflag("V", "version", "output version information and exit"),
];

View file

@ -33,7 +33,7 @@ fn main() { uumain(os::args()); }
pub fn uumain(args: Vec<String>) {
let opts = ~[
let opts = [
// Linux-specific options, not implemented
// getopts::optflag("Z", "context", "set SELinux secutiry context" +
// " of each created directory to CTX"),

View file

@ -29,7 +29,7 @@ fn main() { uumain(os::args()); }
pub fn uumain(args: Vec<String>) {
let program = args.get(0).clone();
let opts = ~[
let opts = [
getopts::optflag("s", "serial", "paste one file at a time instead of in parallel"),
getopts::optopt("d", "delimiters", "reuse characters from LIST instead of TABs", "LIST"),
getopts::optflag("h", "help", "display this help and exit"),

View file

@ -29,7 +29,7 @@ fn main() { uumain(os::args()); }
pub fn uumain(args: Vec<String>) {
let program = args.get(0).clone();
let opts = ~[
let opts = [
getopts::optflag("0", "null", "end each output line with 0 byte rather than newline"),
getopts::optflag("h", "help", "display this help and exit"),
getopts::optflag("V", "version", "output version information and exit"),

View file

@ -28,7 +28,7 @@ fn main() { uumain(os::args()); }
pub fn uumain(args: Vec<String>) {
let program = args.get(0).clone();
let opts = ~[
let opts = [
getopts::optflag("", "help", "display this help and exit"),
getopts::optflag("", "version", "output version information and exit"),
];

View file

@ -36,7 +36,7 @@ pub fn uumain(args: Vec<String>) {
let program = args.get(0).clone();
// TODO: make getopts support -R in addition to -r
let opts = ~[
let opts = [
getopts::optflag("f", "force", "ignore nonexistent files and arguments, never prompt"),
getopts::optflag("i", "", "prompt before every removal"),
getopts::optflag("I", "", "prompt once before removing more than three files, or when removing recursively. Less intrusive than -i, while still giving some protection against most mistakes"),

View file

@ -28,7 +28,7 @@ fn main() { uumain(os::args()); }
pub fn uumain(args: Vec<String>) {
let program = args.get(0).clone();
let opts = ~[
let opts = [
getopts::optflag("", "ignore-fail-on-non-empty", "ignore each failure that is solely because a directory is non-empty"),
getopts::optflag("p", "parents", "remove DIRECTORY and its ancestors; e.g., 'rmdir -p a/b/c' is similar to rmdir a/b/c a/b a"),
getopts::optflag("v", "verbose", "output a diagnostic for every directory processed"),

View file

@ -15,7 +15,7 @@ mod util;
static NAME: &'static str = "seq";
fn print_usage(opts: ~[getopts::OptGroup]) {
fn print_usage(opts: &[getopts::OptGroup]) {
println!("seq 1.0.0\n");
println!("Usage:\n seq [-w] [-s string] [-t string] [first [step]] last\n");
println!("{:s}", getopts::usage("Print sequences of numbers", opts));
@ -37,7 +37,7 @@ fn escape_sequences(s: &str) -> String {
fn main() { uumain(os::args()); }
pub fn uumain(args: Vec<String>) {
let opts = ~[
let opts = [
getopts::optopt("s", "separator", "Separator character (defaults to \\n)", ""),
getopts::optopt("t", "terminator", "Terminator character (defaults to separator)", ""),
getopts::optflag("w", "widths", "Equalize widths of all numbers by padding with zeros"),

View file

@ -29,7 +29,7 @@ fn main() { uumain(os::args()); }
pub fn uumain(args: Vec<String>) {
let program = args.get(0).clone();
let opts = ~[
let opts = [
getopts::optflag("h", "help", "display this help and exit"),
getopts::optflag("V", "version", "output version information and exit")
];

View file

@ -24,7 +24,7 @@ static VERSION: &'static str = "1.0.0";
static NAME: &'static str = "sum";
fn bsd_sum(mut reader: Box<Reader>) -> (uint, u16) {
let mut buf = ~[0, .. 1024];
let mut buf = [0, .. 1024];
let mut blocks_read = 0;
let mut checksum: u16 = 0;
loop {
@ -44,7 +44,7 @@ fn bsd_sum(mut reader: Box<Reader>) -> (uint, u16) {
}
fn sysv_sum(mut reader: Box<Reader>) -> (uint, u16) {
let mut buf = ~[0, .. 512];
let mut buf = [0, .. 512];
let mut blocks_read = 0;
let mut ret = 0;

View file

@ -29,7 +29,7 @@ fn main() { uumain(os::args()); }
pub fn uumain(args: Vec<String>) {
let program = args.get(0).clone();
let opts = ~[
let opts = [
getopts::optflag("b", "before", "attach the separator before instead of after"),
getopts::optflag("r", "regex", "interpret the sequence as a regular expression (NOT IMPLEMENTED)"),
getopts::optopt("s", "separator", "use STRING as the separator instead of newline", "STRING"),

View file

@ -43,7 +43,7 @@ struct Options {
}
fn options(args: &[String]) -> Result<Options, ()> {
let opts = ~[
let opts = [
optflag("a", "append", "append to the given FILEs, do not overwrite"),
optflag("i", "ignore-interrupts", "ignore interrupt signals"),
optflag("h", "help", "display this help and exit"),

View file

@ -26,7 +26,7 @@ static VERSION: &'static str = "1.0.0";
fn main() { uumain(os::args()); }
pub fn uumain(args: Vec<String>) {
let opts = ~[
let opts = [
getopts::optflag("a", "", "change only the access time"),
getopts::optflag("c", "no-create", "do not create any files"),
getopts::optopt( "d", "date", "parse argument and use it instead of current time", "STRING"),

View file

@ -52,7 +52,7 @@ fn main() { uumain(os::args()); }
pub fn uumain(args: Vec<String>) {
let program = args.get(0).clone();
let opts = ~[
let opts = [
getopts::optflag("c", "no-create", "do not create files that do not exist"),
getopts::optflag("o", "io-blocks", "treat SIZE as the number of I/O blocks of the file rather than bytes (NOT IMPLEMENTED)"),
getopts::optopt("r", "reference", "base the size of each file on the size of RFILE", "RFILE"),

View file

@ -56,7 +56,7 @@ fn main() { uumain(os::args()); }
pub fn uumain(args: Vec<String>) {
let program = args.get(0).as_slice();
let opts = ~[
let opts = [
getopts::optflag("h", "help", "display this help and exit"),
getopts::optflag("a", "all", "Behave as though all of the options -mnrsv were specified."),
getopts::optflag("m", "machine", "print the machine hardware name."),

View file

@ -31,7 +31,7 @@ fn main() { uumain(os::args()); }
pub fn uumain(args: Vec<String>) {
let program = args.get(0).clone();
let opts = ~[
let opts = [
getopts::optflag("h", "help", "display this help and exit"),
getopts::optflag("V", "version", "output version information and exit"),
];

View file

@ -52,7 +52,7 @@ fn main() { uumain(os::args()); }
pub fn uumain(args: Vec<String>) {
let program = args.get(0).clone();
let opts = ~[
let opts = [
getopts::optflag("v", "version", "output version information and exit"),
getopts::optflag("h", "help", "display this help and exit"),
];

View file

@ -52,7 +52,7 @@ fn main() { uumain(os::args()); }
pub fn uumain(args: Vec<String>) {
let program = args.get(0).as_slice();
let opts = ~[
let opts = [
getopts::optflag("h", "help", "display this help and exit"),
getopts::optflag("V", "version", "output version information and exit"),
];

View file

@ -38,7 +38,7 @@ fn main() { uumain(os::args()); }
pub fn uumain(args: Vec<String>) {
let program = args.get(0).clone();
let opts = ~[
let opts = [
getopts::optflag("c", "bytes", "print the byte counts"),
getopts::optflag("m", "chars", "print the character counts"),
getopts::optflag("l", "lines", "print the newline counts"),

View file

@ -46,7 +46,7 @@ fn main() { uumain(os::args()); }
pub fn uumain(args: Vec<String>) {
let program = args.get(0).as_slice();
let opts = ~[
let opts = [
getopts::optflag("h", "help", "display this help and exit"),
getopts::optflag("V", "version", "output version information and exit"),
];

View file

@ -29,7 +29,7 @@ fn main() { uumain(os::args()); }
pub fn uumain(args: Vec<String>) {
let program = args.get(0).clone();
let opts = ~[
let opts = [
getopts::optflag("h", "help", "display this help and exit"),
getopts::optflag("V", "version", "output version information and exit"),
];