mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 12:37:49 +00:00
refactor ~ use util_name!()
as clap::app::App name argument for all utils
This commit is contained in:
parent
fa5dc90789
commit
c5792c2a0f
89 changed files with 95 additions and 94 deletions
|
@ -27,7 +27,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.after_help(SUMMARY)
|
||||
|
|
|
@ -93,7 +93,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(SUMMARY)
|
||||
.arg(
|
||||
|
|
|
@ -234,7 +234,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.name(NAME)
|
||||
.version(crate_version!())
|
||||
.usage(SYNTAX)
|
||||
|
|
|
@ -197,7 +197,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(VERSION)
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -116,7 +116,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -165,7 +165,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -92,7 +92,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.usage(SYNTAX)
|
||||
|
|
|
@ -213,7 +213,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.name(NAME)
|
||||
.version(crate_version!())
|
||||
.about(SUMMARY)
|
||||
|
|
|
@ -148,7 +148,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.after_help(LONG_HELP)
|
||||
|
|
|
@ -293,7 +293,7 @@ static DEFAULT_ATTRIBUTES: &[Attribute] = &[
|
|||
];
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(Arg::with_name(options::TARGET_DIRECTORY)
|
||||
|
|
|
@ -739,7 +739,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(SUMMARY)
|
||||
.arg(
|
||||
|
|
|
@ -548,7 +548,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.name(NAME)
|
||||
.version(crate_version!())
|
||||
.usage(SYNTAX)
|
||||
|
|
|
@ -253,7 +253,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -427,7 +427,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -153,7 +153,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(SUMMARY)
|
||||
.after_help(LONG_HELP)
|
||||
|
|
|
@ -86,7 +86,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.about(ABOUT)
|
||||
.version(crate_version!())
|
||||
.arg(
|
||||
|
|
|
@ -625,7 +625,7 @@ fn parse_depth(max_depth_str: Option<&str>, summarize: bool) -> UResult<Option<u
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(SUMMARY)
|
||||
.after_help(LONG_HELP)
|
||||
|
|
|
@ -132,7 +132,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.name(NAME)
|
||||
// TrailingVarArg specifies the final positional argument is a VarArg
|
||||
// and it doesn't attempts the parse any further args.
|
||||
|
|
|
@ -178,7 +178,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.after_help(LONG_HELP)
|
||||
|
|
|
@ -18,7 +18,7 @@ const VERSION: &str = "version";
|
|||
const HELP: &str = "help";
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.arg(Arg::with_name(VERSION).long(VERSION))
|
||||
.arg(Arg::with_name(HELP).long(HELP))
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(SUMMARY)
|
||||
.arg(Arg::with_name(options::NUMBER).multiple(true))
|
||||
|
|
|
@ -9,7 +9,8 @@
|
|||
extern crate uucore;
|
||||
|
||||
use clap::App;
|
||||
use uucore::{error::UResult, executable};
|
||||
use uucore::error::UResult;
|
||||
use uucore::util_name;
|
||||
|
||||
#[uucore_procs::gen_uumain]
|
||||
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||
|
@ -18,5 +19,5 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
}
|
||||
|
|
|
@ -211,7 +211,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -64,7 +64,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.name(NAME)
|
||||
.version(crate_version!())
|
||||
.usage(SYNTAX)
|
||||
|
|
|
@ -85,7 +85,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -342,7 +342,7 @@ pub fn uu_app_common() -> App<'static, 'static> {
|
|||
const TEXT_HELP: &str = "read in text mode";
|
||||
#[cfg(not(windows))]
|
||||
const TEXT_HELP: &str = "read in text mode (default)";
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about("Compute and check message digests.")
|
||||
.arg(
|
||||
|
|
|
@ -9,7 +9,7 @@ use clap::{crate_version, App, Arg};
|
|||
use std::convert::TryFrom;
|
||||
use std::ffi::OsString;
|
||||
use std::io::{self, ErrorKind, Read, Seek, SeekFrom, Write};
|
||||
use uucore::{crash, executable, show_error, show_error_custom_description};
|
||||
use uucore::{crash, show_error_custom_description, util_name};
|
||||
|
||||
const EXIT_FAILURE: i32 = 1;
|
||||
const EXIT_SUCCESS: i32 = 0;
|
||||
|
@ -41,7 +41,7 @@ use lines::zlines;
|
|||
use take::take_all_but;
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.usage(USAGE)
|
||||
|
|
|
@ -29,7 +29,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.usage(SYNTAX)
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ fn execute(args: impl uucore::Args) -> UResult<()> {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -347,7 +347,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -202,7 +202,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -76,7 +76,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -51,7 +51,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -196,7 +196,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -56,7 +56,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(SUMMARY)
|
||||
}
|
||||
|
|
|
@ -618,7 +618,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(
|
||||
"By default, ls will list the files and contents of any directories on \
|
||||
|
|
|
@ -51,7 +51,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -70,7 +70,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.name(NAME)
|
||||
.version(crate_version!())
|
||||
.usage(USAGE)
|
||||
|
|
|
@ -145,7 +145,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.usage(USAGE)
|
||||
.after_help(LONG_HELP)
|
||||
|
|
|
@ -134,7 +134,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -93,7 +93,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.about("A file perusal filter for CRT viewing.")
|
||||
.version(crate_version!())
|
||||
.arg(
|
||||
|
|
|
@ -133,7 +133,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -101,7 +101,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.setting(AppSettings::TrailingVarArg)
|
||||
.version(crate_version!())
|
||||
.arg(
|
||||
|
|
|
@ -143,7 +143,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.name(NAME)
|
||||
.version(crate_version!())
|
||||
.usage(USAGE)
|
||||
|
|
|
@ -71,7 +71,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.after_help(LONG_HELP)
|
||||
|
|
|
@ -70,7 +70,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -175,7 +175,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.after_help(LONG_HELP)
|
||||
|
|
|
@ -252,7 +252,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> clap::App<'static, 'static> {
|
||||
clap::App::new(executable!())
|
||||
clap::App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.usage(USAGE)
|
||||
|
|
|
@ -52,7 +52,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -96,7 +96,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -130,7 +130,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -23,7 +23,7 @@ use std::fs::{metadata, File};
|
|||
use std::io::{stdin, stdout, BufRead, BufReader, Lines, Read, Stdout, Write};
|
||||
#[cfg(unix)]
|
||||
use std::os::unix::fs::FileTypeExt;
|
||||
use uucore::executable;
|
||||
use uucore::util_name;
|
||||
|
||||
type IOError = std::io::Error;
|
||||
|
||||
|
@ -170,7 +170,7 @@ quick_error! {
|
|||
|
||||
pub fn uu_app() -> clap::App<'static, 'static> {
|
||||
// TODO: migrate to clap to get more shell completions
|
||||
clap::App::new(executable!())
|
||||
clap::App::new(util_name!())
|
||||
}
|
||||
|
||||
pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||
|
|
|
@ -55,7 +55,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -303,7 +303,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.arg(Arg::with_name(VERSION).long(VERSION))
|
||||
.arg(Arg::with_name(HELP).long(HELP))
|
||||
}
|
||||
|
|
|
@ -659,7 +659,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.name(NAME)
|
||||
.version(crate_version!())
|
||||
.usage(BRIEF)
|
||||
|
|
|
@ -66,7 +66,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -98,7 +98,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -55,7 +55,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -82,7 +82,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -140,7 +140,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -163,7 +163,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.setting(AppSettings::AllowLeadingHyphen)
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
|
|
|
@ -330,7 +330,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.after_help(AFTER_HELP)
|
||||
|
|
|
@ -115,7 +115,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.name(NAME)
|
||||
.version(crate_version!())
|
||||
.template(TEMPLATE)
|
||||
|
|
|
@ -49,7 +49,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.after_help(LONG_HELP)
|
||||
|
|
|
@ -1287,7 +1287,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -127,7 +127,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about("Create output files containing consecutive or interleaved sections of input")
|
||||
// strategy (mutually exclusive)
|
||||
|
|
|
@ -963,7 +963,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -185,7 +185,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.after_help(LONG_HELP)
|
||||
|
|
|
@ -140,7 +140,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.name(NAME)
|
||||
.version(crate_version!())
|
||||
.usage(USAGE)
|
||||
|
|
|
@ -193,7 +193,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -51,7 +51,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.name(NAME)
|
||||
.version(crate_version!())
|
||||
.usage(USAGE)
|
||||
|
|
|
@ -213,7 +213,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about("output the last part of files")
|
||||
// TODO: add usage
|
||||
|
|
|
@ -57,7 +57,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.after_help("If a FILE is -, it refers to a file named - .")
|
||||
|
|
|
@ -14,7 +14,7 @@ use clap::{crate_version, App, AppSettings};
|
|||
use parser::{parse, Symbol};
|
||||
use std::ffi::{OsStr, OsString};
|
||||
use std::path::Path;
|
||||
use uucore::executable;
|
||||
use uucore::util_name;
|
||||
|
||||
const USAGE: &str = "test EXPRESSION
|
||||
or: test
|
||||
|
@ -87,7 +87,7 @@ the version described here. Please refer to your shell's documentation
|
|||
for details about the options it supports.";
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.setting(AppSettings::DisableHelpFlags)
|
||||
.setting(AppSettings::DisableVersion)
|
||||
}
|
||||
|
|
|
@ -129,7 +129,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -312,7 +312,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -10,7 +10,7 @@ extern crate uucore;
|
|||
|
||||
use clap::App;
|
||||
use uucore::error::UResult;
|
||||
use uucore::executable;
|
||||
use uucore::util_name;
|
||||
|
||||
#[uucore_procs::gen_uumain]
|
||||
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||
|
@ -19,5 +19,5 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
}
|
||||
|
|
|
@ -133,7 +133,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -90,7 +90,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.usage(USAGE)
|
||||
.about(SUMMARY)
|
||||
|
|
|
@ -78,7 +78,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -119,7 +119,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(Arg::with_name(options::ALL)
|
||||
|
|
|
@ -102,7 +102,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.name(NAME)
|
||||
.version(crate_version!())
|
||||
.usage(USAGE)
|
||||
|
|
|
@ -281,7 +281,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -95,7 +95,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(Arg::with_name(OPT_PATH).hidden(true).multiple(true))
|
||||
|
|
|
@ -64,7 +64,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -65,7 +65,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(Arg::with_name(ARG_FILES).takes_value(true).max_values(1))
|
||||
|
|
|
@ -164,7 +164,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
|
@ -160,7 +160,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
|||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(util_name!())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue