diff --git a/src/uu/arch/src/arch.rs b/src/uu/arch/src/arch.rs index a92ea6226..69747add2 100644 --- a/src/uu/arch/src/arch.rs +++ b/src/uu/arch/src/arch.rs @@ -17,7 +17,7 @@ static SUMMARY: &str = "Determine architecture name for current machine."; static LONG_HELP: &str = ""; pub fn uumain(args: Vec) -> i32 { - new_coreopts!(SYNTAX, SUMMARY, LONG_HELP).parse(args); + app!(SYNTAX, SUMMARY, LONG_HELP).parse(args); let uts = return_if_err!(1, PlatformInfo::new()); println!("{}", uts.machine().trim()); 0 diff --git a/src/uu/base32/src/base_common.rs b/src/uu/base32/src/base_common.rs index bbd178498..361429d94 100644 --- a/src/uu/base32/src/base_common.rs +++ b/src/uu/base32/src/base_common.rs @@ -20,7 +20,7 @@ pub fn execute( long_help: &str, format: Format, ) -> i32 { - let matches = new_coreopts!(syntax, summary, long_help) + let matches = app!(syntax, summary, long_help) .optflag("d", "decode", "decode data") .optflag( "i", diff --git a/src/uu/base64/src/base_common.rs b/src/uu/base64/src/base_common.rs index bbd178498..361429d94 100644 --- a/src/uu/base64/src/base_common.rs +++ b/src/uu/base64/src/base_common.rs @@ -20,7 +20,7 @@ pub fn execute( long_help: &str, format: Format, ) -> i32 { - let matches = new_coreopts!(syntax, summary, long_help) + let matches = app!(syntax, summary, long_help) .optflag("d", "decode", "decode data") .optflag( "i", diff --git a/src/uu/basename/src/basename.rs b/src/uu/basename/src/basename.rs index d8f492f55..5b78b3567 100644 --- a/src/uu/basename/src/basename.rs +++ b/src/uu/basename/src/basename.rs @@ -20,7 +20,7 @@ pub fn uumain(args: Vec) -> i32 { // // Argument parsing // - let matches = new_coreopts!(SYNTAX, SUMMARY, LONG_HELP) + let matches = app!(SYNTAX, SUMMARY, LONG_HELP) .optflag( "a", "multiple", diff --git a/src/uu/cat/src/cat.rs b/src/uu/cat/src/cat.rs index b0f0b1171..e65687c66 100644 --- a/src/uu/cat/src/cat.rs +++ b/src/uu/cat/src/cat.rs @@ -123,7 +123,7 @@ enum InputType { type CatResult = Result; pub fn uumain(args: Vec) -> i32 { - let matches = new_coreopts!(SYNTAX, SUMMARY, LONG_HELP) + let matches = app!(SYNTAX, SUMMARY, LONG_HELP) .optflag("A", "show-all", "equivalent to -vET") .optflag( "b", diff --git a/src/uu/chgrp/src/chgrp.rs b/src/uu/chgrp/src/chgrp.rs index f781c77a4..78af36398 100644 --- a/src/uu/chgrp/src/chgrp.rs +++ b/src/uu/chgrp/src/chgrp.rs @@ -35,7 +35,7 @@ const FTS_PHYSICAL: u8 = 1 << 1; const FTS_LOGICAL: u8 = 1 << 2; pub fn uumain(args: Vec) -> i32 { - let mut opts = new_coreopts!(SYNTAX, SUMMARY, ""); + let mut opts = app!(SYNTAX, SUMMARY, ""); opts.optflag("c", "changes", "like verbose but report only when a change is made") diff --git a/src/uu/chmod/src/chmod.rs b/src/uu/chmod/src/chmod.rs index 5f1ab050a..4255ae178 100644 --- a/src/uu/chmod/src/chmod.rs +++ b/src/uu/chmod/src/chmod.rs @@ -34,7 +34,7 @@ pub fn uumain(mut args: Vec) -> i32 { {0} [OPTION]... --reference=RFILE FILE...", NAME ); - let mut opts = new_coreopts!(&syntax, SUMMARY, LONG_HELP); + let mut opts = app!(&syntax, SUMMARY, LONG_HELP); opts.optflag( "c", "changes", diff --git a/src/uu/chown/src/chown.rs b/src/uu/chown/src/chown.rs index 777950de0..2ecd49f43 100644 --- a/src/uu/chown/src/chown.rs +++ b/src/uu/chown/src/chown.rs @@ -37,7 +37,7 @@ const FTS_PHYSICAL: u8 = 1 << 1; const FTS_LOGICAL: u8 = 1 << 2; pub fn uumain(args: Vec) -> i32 { - let mut opts = new_coreopts!(SYNTAX, SUMMARY, ""); + let mut opts = app!(SYNTAX, SUMMARY, ""); opts.optflag("c", "changes", "like verbose but report only when a change is made") diff --git a/src/uu/chroot/src/chroot.rs b/src/uu/chroot/src/chroot.rs index eaa718298..a8122deb9 100644 --- a/src/uu/chroot/src/chroot.rs +++ b/src/uu/chroot/src/chroot.rs @@ -28,7 +28,7 @@ static LONG_HELP: &str = " "; pub fn uumain(args: Vec) -> i32 { - let matches = new_coreopts!(SYNTAX, SUMMARY, LONG_HELP) + let matches = app!(SYNTAX, SUMMARY, LONG_HELP) .optopt( "u", "user", diff --git a/src/uu/cksum/src/cksum.rs b/src/uu/cksum/src/cksum.rs index 330fac646..14b2edb32 100644 --- a/src/uu/cksum/src/cksum.rs +++ b/src/uu/cksum/src/cksum.rs @@ -70,7 +70,7 @@ fn cksum(fname: &str) -> io::Result<(u32, usize)> { } pub fn uumain(args: Vec) -> i32 { - let matches = new_coreopts!(SYNTAX, SUMMARY, LONG_HELP).parse(args); + let matches = app!(SYNTAX, SUMMARY, LONG_HELP).parse(args); let files = matches.free; diff --git a/src/uu/comm/src/comm.rs b/src/uu/comm/src/comm.rs index c98420004..54c0a7115 100644 --- a/src/uu/comm/src/comm.rs +++ b/src/uu/comm/src/comm.rs @@ -120,7 +120,7 @@ fn open_file(name: &str) -> io::Result { } pub fn uumain(args: Vec) -> i32 { - let matches = new_coreopts!(SYNTAX, SUMMARY, LONG_HELP) + let matches = app!(SYNTAX, SUMMARY, LONG_HELP) .optflag("1", "", "suppress column 1 (lines uniq to FILE1)") .optflag("2", "", "suppress column 2 (lines uniq to FILE2)") .optflag( diff --git a/src/uu/cut/src/cut.rs b/src/uu/cut/src/cut.rs index 1d4381855..7cf8fa776 100644 --- a/src/uu/cut/src/cut.rs +++ b/src/uu/cut/src/cut.rs @@ -422,7 +422,7 @@ fn cut_files(mut filenames: Vec, mode: Mode) -> i32 { } pub fn uumain(args: Vec) -> i32 { - let matches = new_coreopts!(SYNTAX, SUMMARY, LONG_HELP) + let matches = app!(SYNTAX, SUMMARY, LONG_HELP) .optopt("b", "bytes", "filter byte columns from the input source", "sequence") .optopt("c", "characters", "alias for character mode", "sequence") .optopt("d", "delimiter", "specify the delimiter character that separates fields in the input source. Defaults to Tab.", "delimiter") diff --git a/src/uu/dircolors/src/dircolors.rs b/src/uu/dircolors/src/dircolors.rs index 173c15d75..9227f4241 100644 --- a/src/uu/dircolors/src/dircolors.rs +++ b/src/uu/dircolors/src/dircolors.rs @@ -53,7 +53,7 @@ pub fn guess_syntax() -> OutputFmt { } pub fn uumain(args: Vec) -> i32 { - let matches = new_coreopts!(SYNTAX, SUMMARY, LONG_HELP) + let matches = app!(SYNTAX, SUMMARY, LONG_HELP) .optflag("b", "sh", "output Bourne shell code to set LS_COLORS") .optflag( "", diff --git a/src/uu/dirname/src/dirname.rs b/src/uu/dirname/src/dirname.rs index 7ec5df8cc..987708adc 100644 --- a/src/uu/dirname/src/dirname.rs +++ b/src/uu/dirname/src/dirname.rs @@ -20,7 +20,7 @@ static LONG_HELP: &str = " "; pub fn uumain(args: Vec) -> i32 { - let matches = new_coreopts!(SYNTAX, SUMMARY, LONG_HELP) + let matches = app!(SYNTAX, SUMMARY, LONG_HELP) .optflag("z", "zero", "separate output with NUL rather than newline") .parse(args); diff --git a/src/uu/du/src/du.rs b/src/uu/du/src/du.rs index 76fddba4a..c9da05747 100644 --- a/src/uu/du/src/du.rs +++ b/src/uu/du/src/du.rs @@ -229,7 +229,7 @@ pub fn uumain(args: Vec) -> i32 { {0} [OPTION]... --files0-from=F", NAME ); - let matches = new_coreopts!(&syntax, SUMMARY, LONG_HELP) + let matches = app!(&syntax, SUMMARY, LONG_HELP) // In task .optflag( "a", diff --git a/src/uu/echo/src/echo.rs b/src/uu/echo/src/echo.rs index acb33ad5f..94013393f 100644 --- a/src/uu/echo/src/echo.rs +++ b/src/uu/echo/src/echo.rs @@ -103,7 +103,7 @@ fn print_escaped(input: &str, mut output: impl Write) -> io::Result { } pub fn uumain(args: Vec) -> i32 { - let matches = new_coreopts!(SYNTAX, SUMMARY, HELP) + let matches = app!(SYNTAX, SUMMARY, HELP) .optflag("n", "", "do not output the trailing newline") .optflag("e", "", "enable interpretation of backslash escapes") .optflag( diff --git a/src/uu/expand/src/expand.rs b/src/uu/expand/src/expand.rs index 6c8f2e95a..da2fbeb3a 100644 --- a/src/uu/expand/src/expand.rs +++ b/src/uu/expand/src/expand.rs @@ -99,7 +99,7 @@ impl Options { } pub fn uumain(args: Vec) -> i32 { - let matches = new_coreopts!(SYNTAX, SUMMARY, LONG_HELP) + let matches = app!(SYNTAX, SUMMARY, LONG_HELP) .optflag("i", "initial", "do not convert tabs after non blanks") .optopt( "t", diff --git a/src/uu/factor/src/factor.rs b/src/uu/factor/src/factor.rs index 55b0d3780..2fcf66ad4 100644 --- a/src/uu/factor/src/factor.rs +++ b/src/uu/factor/src/factor.rs @@ -116,7 +116,7 @@ fn print_factors_str(num_str: &str) { } pub fn uumain(args: Vec) -> i32 { - let matches = new_coreopts!(SYNTAX, SUMMARY, LONG_HELP).parse(args); + let matches = app!(SYNTAX, SUMMARY, LONG_HELP).parse(args); if matches.free.is_empty() { let stdin = stdin(); diff --git a/src/uu/fmt/src/fmt.rs b/src/uu/fmt/src/fmt.rs index 7d7d2156c..cda4431b3 100644 --- a/src/uu/fmt/src/fmt.rs +++ b/src/uu/fmt/src/fmt.rs @@ -56,7 +56,7 @@ pub struct FmtOptions { #[allow(clippy::cognitive_complexity)] pub fn uumain(args: Vec) -> i32 { - let matches = new_coreopts!(SYNTAX, SUMMARY, LONG_HELP) + let matches = app!(SYNTAX, SUMMARY, LONG_HELP) .optflag("c", "crown-margin", "First and second line of paragraph may have different indentations, in which case the first line's indentation is preserved, and each subsequent line's indentation matches the second line.") .optflag("t", "tagged-paragraph", "Like -c, except that the first and second line of a paragraph *must* have different indentation or they are treated as separate paragraphs.") .optflag("m", "preserve-headers", "Attempt to detect and preserve mail headers in the input. Be careful when combining this flag with -p.") diff --git a/src/uu/fold/src/fold.rs b/src/uu/fold/src/fold.rs index 41aabf3b6..e3321d19d 100644 --- a/src/uu/fold/src/fold.rs +++ b/src/uu/fold/src/fold.rs @@ -19,7 +19,7 @@ static LONG_HELP: &str = ""; pub fn uumain(args: Vec) -> i32 { let (args, obs_width) = handle_obsolete(&args[..]); - let matches = new_coreopts!(SYNTAX, SUMMARY, LONG_HELP) + let matches = app!(SYNTAX, SUMMARY, LONG_HELP) .optflag( "b", "bytes", diff --git a/src/uu/groups/src/groups.rs b/src/uu/groups/src/groups.rs index d62d7882c..0cfad3560 100644 --- a/src/uu/groups/src/groups.rs +++ b/src/uu/groups/src/groups.rs @@ -14,7 +14,7 @@ static SYNTAX: &str = "[user]"; static SUMMARY: &str = "display current group names"; pub fn uumain(args: Vec) -> i32 { - let matches = new_coreopts!(SYNTAX, SUMMARY, "").parse(args); + let matches = app!(SYNTAX, SUMMARY, "").parse(args); if matches.free.is_empty() { println!( diff --git a/src/uu/head/src/head.rs b/src/uu/head/src/head.rs index 504d26fdc..97a34e8c7 100644 --- a/src/uu/head/src/head.rs +++ b/src/uu/head/src/head.rs @@ -52,7 +52,7 @@ pub fn uumain(args: Vec) -> i32 { (args, None) => args, }; - let matches = new_coreopts!(SYNTAX, SUMMARY, LONG_HELP) + let matches = app!(SYNTAX, SUMMARY, LONG_HELP) .optopt( "c", "bytes", diff --git a/src/uu/hostid/src/hostid.rs b/src/uu/hostid/src/hostid.rs index 86b39e928..1bb61086c 100644 --- a/src/uu/hostid/src/hostid.rs +++ b/src/uu/hostid/src/hostid.rs @@ -22,7 +22,7 @@ extern "C" { } pub fn uumain(args: Vec) -> i32 { - new_coreopts!(SYNTAX, SUMMARY, LONG_HELP).parse(args); + app!(SYNTAX, SUMMARY, LONG_HELP).parse(args); hostid(); 0 } diff --git a/src/uu/id/src/id.rs b/src/uu/id/src/id.rs index f34839950..706e9912b 100644 --- a/src/uu/id/src/id.rs +++ b/src/uu/id/src/id.rs @@ -70,7 +70,7 @@ static SYNTAX: &str = "[OPTION]... [USER]"; static SUMMARY: &str = "Print user and group information for the specified USER,\n or (when USER omitted) for the current user."; pub fn uumain(args: Vec) -> i32 { - let mut opts = new_coreopts!(SYNTAX, SUMMARY, ""); + let mut opts = app!(SYNTAX, SUMMARY, ""); opts.optflag( "A", "", diff --git a/src/uu/install/src/install.rs b/src/uu/install/src/install.rs index 9883d3040..52e359a89 100644 --- a/src/uu/install/src/install.rs +++ b/src/uu/install/src/install.rs @@ -96,7 +96,7 @@ fn parse_opts(args: Vec) -> getopts::Matches { {} SOURCE... DIRECTORY", NAME ); - new_coreopts!(&syntax, SUMMARY, LONG_HELP) + app!(&syntax, SUMMARY, LONG_HELP) // TODO implement flag .optflagopt( "", diff --git a/src/uu/kill/src/kill.rs b/src/uu/kill/src/kill.rs index e7d5e9869..896166daf 100644 --- a/src/uu/kill/src/kill.rs +++ b/src/uu/kill/src/kill.rs @@ -30,7 +30,7 @@ pub enum Mode { pub fn uumain(args: Vec) -> i32 { let (args, obs_signal) = handle_obsolete(args); - let matches = new_coreopts!(SYNTAX, SUMMARY, LONG_HELP) + let matches = app!(SYNTAX, SUMMARY, LONG_HELP) .optopt("s", "signal", "specify the to be sent", "SIGNAL") .optflagopt( "l", diff --git a/src/uu/link/src/link.rs b/src/uu/link/src/link.rs index 9cf21ccb6..23de5e3b4 100644 --- a/src/uu/link/src/link.rs +++ b/src/uu/link/src/link.rs @@ -24,7 +24,7 @@ pub fn normalize_error_message(e: Error) -> String { } pub fn uumain(args: Vec) -> i32 { - let matches = new_coreopts!(SYNTAX, SUMMARY, LONG_HELP).parse(args); + let matches = app!(SYNTAX, SUMMARY, LONG_HELP).parse(args); if matches.free.len() != 2 { crash!(1, "{}", msg_wrong_number_of_arguments!(2)); } diff --git a/src/uu/ln/src/ln.rs b/src/uu/ln/src/ln.rs index 1e25b870b..9c2a08f86 100644 --- a/src/uu/ln/src/ln.rs +++ b/src/uu/ln/src/ln.rs @@ -62,7 +62,7 @@ pub fn uumain(args: Vec) -> i32 { {0} [OPTION]... -t DIRECTORY TARGET... (4th form)", NAME ); - let matches = new_coreopts!(&syntax, SUMMARY, LONG_HELP) + let matches = app!(&syntax, SUMMARY, LONG_HELP) .optflag( "b", "", diff --git a/src/uu/logname/src/logname.rs b/src/uu/logname/src/logname.rs index b5ff07cf8..37ce5e689 100644 --- a/src/uu/logname/src/logname.rs +++ b/src/uu/logname/src/logname.rs @@ -35,7 +35,7 @@ static SUMMARY: &str = "Print user's login name"; static LONG_HELP: &str = ""; pub fn uumain(args: Vec) -> i32 { - new_coreopts!(SYNTAX, SUMMARY, LONG_HELP).parse(args); + app!(SYNTAX, SUMMARY, LONG_HELP).parse(args); exec(); diff --git a/src/uu/ls/src/ls.rs b/src/uu/ls/src/ls.rs index c121b6280..64dbf4f42 100644 --- a/src/uu/ls/src/ls.rs +++ b/src/uu/ls/src/ls.rs @@ -80,7 +80,7 @@ pub fn uumain(args: Vec) -> i32 { {0} [OPTION]... [FILE]...", NAME ); - let matches = new_coreopts!(&syntax, SUMMARY, LONG_HELP) + let matches = app!(&syntax, SUMMARY, LONG_HELP) .optflag("1", "", "list one file per line.") .optflag( "a", diff --git a/src/uu/pinky/src/pinky.rs b/src/uu/pinky/src/pinky.rs index a9b442601..9d158870e 100644 --- a/src/uu/pinky/src/pinky.rs +++ b/src/uu/pinky/src/pinky.rs @@ -47,7 +47,7 @@ pub fn uumain(args: Vec) -> i32 { The utmp file will be {}", utmpx::DEFAULT_FILE ); - let mut opts = new_coreopts!(SYNTAX, SUMMARY, &long_help); + let mut opts = app!(SYNTAX, SUMMARY, &long_help); opts.optflag( "l", "", diff --git a/src/uu/who/src/who.rs b/src/uu/who/src/who.rs index 9587a9d3e..524a6cbc1 100644 --- a/src/uu/who/src/who.rs +++ b/src/uu/who/src/who.rs @@ -45,7 +45,7 @@ If ARG1 ARG2 given, -m presumed: 'am i' or 'mom likes' are usual. "; pub fn uumain(args: Vec) -> i32 { - let mut opts = new_coreopts!(SYNTAX, SUMMARY, LONG_HELP); + let mut opts = app!(SYNTAX, SUMMARY, LONG_HELP); opts.optflag("a", "all", "same as -b -d --login -p -r -t -T -u"); opts.optflag("b", "boot", "time of last system boot"); opts.optflag("d", "dead", "print dead processes");