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:
parent
4107b265ba
commit
448f4d6d70
28 changed files with 30 additions and 30 deletions
|
@ -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",
|
||||
|
|
|
@ -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"),
|
||||
];
|
||||
|
|
2
cp/cp.rs
2
cp/cp.rs
|
@ -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"),
|
||||
];
|
||||
|
|
|
@ -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"),
|
||||
|
|
2
du/du.rs
2
du/du.rs
|
@ -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
|
||||
|
|
|
@ -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)"),
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -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"),
|
||||
];
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -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"),
|
||||
];
|
||||
|
|
2
rm/rm.rs
2
rm/rm.rs
|
@ -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"),
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -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")
|
||||
];
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -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."),
|
||||
|
|
|
@ -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"),
|
||||
];
|
||||
|
|
|
@ -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"),
|
||||
];
|
||||
|
|
|
@ -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"),
|
||||
];
|
||||
|
|
2
wc/wc.rs
2
wc/wc.rs
|
@ -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"),
|
||||
|
|
|
@ -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"),
|
||||
];
|
||||
|
|
|
@ -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"),
|
||||
];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue