mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
Merge pull request #2471 from miDeb/real-exe-name
make executable!() return the real executable name
This commit is contained in:
@@ -70,6 +70,7 @@ fn main() {
|
||||
Some(OsString::from(*util))
|
||||
} else {
|
||||
// unmatched binary name => regard as multi-binary container and advance argument list
|
||||
uucore::set_utility_is_second_arg();
|
||||
args.next()
|
||||
};
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(uucore::util_name())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.after_help(SUMMARY)
|
||||
|
||||
@@ -28,17 +28,17 @@ static VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||
|
||||
static BASE_CMD_PARSE_ERROR: i32 = 1;
|
||||
|
||||
fn get_usage() -> String {
|
||||
format!("{0} [OPTION]... [FILE]", executable!())
|
||||
fn usage() -> String {
|
||||
format!("{0} [OPTION]... [FILE]", uucore::execution_phrase())
|
||||
}
|
||||
|
||||
pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||
let format = Format::Base32;
|
||||
let usage = get_usage();
|
||||
let name = executable!();
|
||||
let usage = usage();
|
||||
let name = uucore::util_name();
|
||||
|
||||
let config_result: Result<base_common::Config, String> =
|
||||
base_common::parse_base_cmd_args(args, name, VERSION, ABOUT, &usage);
|
||||
base_common::parse_base_cmd_args(args, &name, VERSION, ABOUT, &usage);
|
||||
let config = config_result.unwrap_or_else(|s| crash!(BASE_CMD_PARSE_ERROR, "{}", s));
|
||||
|
||||
// Create a reference to stdin so we can return a locked stdin from
|
||||
@@ -52,12 +52,12 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||
config.wrap_cols,
|
||||
config.ignore_garbage,
|
||||
config.decode,
|
||||
name,
|
||||
&name,
|
||||
);
|
||||
|
||||
0
|
||||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
base_common::base_app(executable!(), VERSION, ABOUT)
|
||||
base_common::base_app(&uucore::util_name(), VERSION, ABOUT)
|
||||
}
|
||||
|
||||
@@ -29,16 +29,16 @@ static VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||
|
||||
static BASE_CMD_PARSE_ERROR: i32 = 1;
|
||||
|
||||
fn get_usage() -> String {
|
||||
format!("{0} [OPTION]... [FILE]", executable!())
|
||||
fn usage() -> String {
|
||||
format!("{0} [OPTION]... [FILE]", uucore::execution_phrase())
|
||||
}
|
||||
|
||||
pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||
let format = Format::Base64;
|
||||
let usage = get_usage();
|
||||
let name = executable!();
|
||||
let usage = usage();
|
||||
let name = uucore::util_name();
|
||||
let config_result: Result<base_common::Config, String> =
|
||||
base_common::parse_base_cmd_args(args, name, VERSION, ABOUT, &usage);
|
||||
base_common::parse_base_cmd_args(args, &name, VERSION, ABOUT, &usage);
|
||||
let config = config_result.unwrap_or_else(|s| crash!(BASE_CMD_PARSE_ERROR, "{}", s));
|
||||
|
||||
// Create a reference to stdin so we can return a locked stdin from
|
||||
@@ -52,7 +52,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||
config.wrap_cols,
|
||||
config.ignore_garbage,
|
||||
config.decode,
|
||||
name,
|
||||
&name,
|
||||
);
|
||||
|
||||
0
|
||||
|
||||
@@ -17,11 +17,11 @@ use uucore::InvalidEncodingHandling;
|
||||
static SUMMARY: &str = "Print NAME with any leading directory components removed
|
||||
If specified, also remove a trailing SUFFIX";
|
||||
|
||||
fn get_usage() -> String {
|
||||
fn usage() -> String {
|
||||
format!(
|
||||
"{0} NAME [SUFFIX]
|
||||
{0} OPTION... NAME...",
|
||||
executable!()
|
||||
uucore::execution_phrase()
|
||||
)
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||
let args = args
|
||||
.collect_str(InvalidEncodingHandling::ConvertLossy)
|
||||
.accept_any();
|
||||
let usage = get_usage();
|
||||
let usage = usage();
|
||||
//
|
||||
// Argument parsing
|
||||
//
|
||||
@@ -47,7 +47,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||
crash!(
|
||||
1,
|
||||
"{1}\nTry '{0} --help' for more information.",
|
||||
executable!(),
|
||||
uucore::execution_phrase(),
|
||||
"missing operand"
|
||||
);
|
||||
}
|
||||
@@ -61,7 +61,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||
crash!(
|
||||
1,
|
||||
"extra operand '{1}'\nTry '{0} --help' for more information.",
|
||||
executable!(),
|
||||
uucore::execution_phrase(),
|
||||
matches.values_of(options::NAME).unwrap().nth(2).unwrap()
|
||||
);
|
||||
}
|
||||
@@ -93,7 +93,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(uucore::util_name())
|
||||
.version(crate_version!())
|
||||
.about(SUMMARY)
|
||||
.arg(
|
||||
|
||||
@@ -42,12 +42,12 @@ const ENCODINGS: &[(&str, Format)] = &[
|
||||
("base2m", Format::Base2Msbf),
|
||||
];
|
||||
|
||||
fn get_usage() -> String {
|
||||
format!("{0} [OPTION]... [FILE]", executable!())
|
||||
fn usage() -> String {
|
||||
format!("{0} [OPTION]... [FILE]", uucore::execution_phrase())
|
||||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
let mut app = base_common::base_app(executable!(), crate_version!(), ABOUT);
|
||||
let mut app = base_common::base_app(&uucore::util_name(), crate_version!(), ABOUT);
|
||||
for encoding in ENCODINGS {
|
||||
app = app.arg(Arg::with_name(encoding.0).long(encoding.0));
|
||||
}
|
||||
@@ -55,7 +55,7 @@ pub fn uu_app() -> App<'static, 'static> {
|
||||
}
|
||||
|
||||
fn parse_cmd_args(args: impl uucore::Args) -> (Config, Format) {
|
||||
let usage = get_usage();
|
||||
let usage = usage();
|
||||
let matches = uu_app().usage(&usage[..]).get_matches_from(
|
||||
args.collect_str(InvalidEncodingHandling::ConvertLossy)
|
||||
.accept_any(),
|
||||
@@ -75,7 +75,7 @@ fn parse_cmd_args(args: impl uucore::Args) -> (Config, Format) {
|
||||
}
|
||||
|
||||
pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||
let name = executable!();
|
||||
let name = uucore::util_name();
|
||||
let (config, format) = parse_cmd_args(args);
|
||||
// Create a reference to stdin so we can return a locked stdin from
|
||||
// parse_base_cmd_args
|
||||
@@ -88,7 +88,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||
config.wrap_cols,
|
||||
config.ignore_garbage,
|
||||
config.decode,
|
||||
name,
|
||||
&name,
|
||||
);
|
||||
|
||||
0
|
||||
|
||||
@@ -234,7 +234,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(uucore::util_name())
|
||||
.name(NAME)
|
||||
.version(crate_version!())
|
||||
.usage(SYNTAX)
|
||||
@@ -396,7 +396,7 @@ fn cat_files(files: Vec<String>, options: &OutputOptions) -> UResult<()> {
|
||||
Ok(())
|
||||
} else {
|
||||
// each next line is expected to display "cat: …"
|
||||
let line_joiner = format!("\n{}: ", executable!());
|
||||
let line_joiner = format!("\n{}: ", uucore::util_name());
|
||||
|
||||
Err(uucore::error::USimpleError::new(
|
||||
error_messages.len() as i32,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#![allow(clippy::upper_case_acronyms)]
|
||||
|
||||
use uucore::{executable, show_error, show_usage_error, show_warning};
|
||||
use uucore::{show_error, show_usage_error, show_warning};
|
||||
|
||||
use clap::{App, Arg};
|
||||
use selinux::{OpaqueSecurityContext, SecurityContext};
|
||||
@@ -56,7 +56,7 @@ fn get_usage() -> String {
|
||||
"{0} [OPTION]... CONTEXT FILE... \n \
|
||||
{0} [OPTION]... [-u USER] [-r ROLE] [-l RANGE] [-t TYPE] FILE... \n \
|
||||
{0} [OPTION]... --reference=RFILE FILE...",
|
||||
executable!()
|
||||
uucore::execution_phrase()
|
||||
)
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(uucore::util_name())
|
||||
.version(VERSION)
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
@@ -563,7 +563,7 @@ fn process_file(
|
||||
if options.verbose {
|
||||
println!(
|
||||
"{}: Changing security context of: {}",
|
||||
executable!(),
|
||||
uucore::util_name(),
|
||||
file_full_name.to_string_lossy()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -59,10 +59,10 @@ const FTS_COMFOLLOW: u8 = 1;
|
||||
const FTS_PHYSICAL: u8 = 1 << 1;
|
||||
const FTS_LOGICAL: u8 = 1 << 2;
|
||||
|
||||
fn get_usage() -> String {
|
||||
fn usage() -> String {
|
||||
format!(
|
||||
"{0} [OPTION]... GROUP FILE...\n {0} [OPTION]... --reference=RFILE FILE...",
|
||||
executable!()
|
||||
uucore::execution_phrase()
|
||||
)
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||
.collect_str(InvalidEncodingHandling::ConvertLossy)
|
||||
.accept_any();
|
||||
|
||||
let usage = get_usage();
|
||||
let usage = usage();
|
||||
|
||||
let mut app = uu_app().usage(&usage[..]);
|
||||
|
||||
@@ -197,7 +197,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(uucore::util_name())
|
||||
.version(VERSION)
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
||||
@@ -36,12 +36,12 @@ mod options {
|
||||
pub const FILE: &str = "FILE";
|
||||
}
|
||||
|
||||
fn get_usage() -> String {
|
||||
fn usage() -> String {
|
||||
format!(
|
||||
"{0} [OPTION]... MODE[,MODE]... FILE...
|
||||
or: {0} [OPTION]... OCTAL-MODE FILE...
|
||||
or: {0} [OPTION]... --reference=RFILE FILE...",
|
||||
executable!()
|
||||
uucore::execution_phrase()
|
||||
)
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||
// a possible MODE prefix '-' needs to be removed (e.g. "chmod -x FILE").
|
||||
let mode_had_minus_prefix = strip_minus_from_mode(&mut args);
|
||||
|
||||
let usage = get_usage();
|
||||
let usage = usage();
|
||||
let after_help = get_long_usage();
|
||||
|
||||
let matches = uu_app()
|
||||
@@ -116,7 +116,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(uucore::util_name())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
||||
@@ -61,10 +61,10 @@ const FTS_COMFOLLOW: u8 = 1;
|
||||
const FTS_PHYSICAL: u8 = 1 << 1;
|
||||
const FTS_LOGICAL: u8 = 1 << 2;
|
||||
|
||||
fn get_usage() -> String {
|
||||
fn usage() -> String {
|
||||
format!(
|
||||
"{0} [OPTION]... [OWNER][:[GROUP]] FILE...\n{0} [OPTION]... --reference=RFILE FILE...",
|
||||
executable!()
|
||||
uucore::execution_phrase()
|
||||
)
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||
.collect_str(InvalidEncodingHandling::Ignore)
|
||||
.accept_any();
|
||||
|
||||
let usage = get_usage();
|
||||
let usage = usage();
|
||||
|
||||
let matches = uu_app().usage(&usage[..]).get_matches_from(args);
|
||||
|
||||
@@ -165,7 +165,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(uucore::util_name())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
||||
@@ -18,7 +18,6 @@ use std::process::Command;
|
||||
use uucore::libc::{self, chroot, setgid, setgroups, setuid};
|
||||
use uucore::{entries, InvalidEncodingHandling};
|
||||
|
||||
static NAME: &str = "chroot";
|
||||
static ABOUT: &str = "Run COMMAND with root directory set to NEWROOT.";
|
||||
static SYNTAX: &str = "[OPTION]... NEWROOT [COMMAND [ARG]...]";
|
||||
|
||||
@@ -47,7 +46,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||
None => crash!(
|
||||
1,
|
||||
"Missing operand: NEWROOT\nTry '{} --help' for more information.",
|
||||
NAME
|
||||
uucore::execution_phrase()
|
||||
),
|
||||
};
|
||||
|
||||
@@ -92,7 +91,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(uucore::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(uucore::util_name())
|
||||
.name(NAME)
|
||||
.version(crate_version!())
|
||||
.about(SUMMARY)
|
||||
|
||||
@@ -7,9 +7,6 @@
|
||||
|
||||
// spell-checker:ignore (ToDO) delim mkdelim
|
||||
|
||||
#[macro_use]
|
||||
extern crate uucore;
|
||||
|
||||
use std::cmp::Ordering;
|
||||
use std::fs::File;
|
||||
use std::io::{self, stdin, BufRead, BufReader, Stdin};
|
||||
@@ -31,8 +28,8 @@ mod options {
|
||||
pub const FILE_2: &str = "FILE2";
|
||||
}
|
||||
|
||||
fn get_usage() -> String {
|
||||
format!("{} [OPTION]... FILE1 FILE2", executable!())
|
||||
fn usage() -> String {
|
||||
format!("{} [OPTION]... FILE1 FILE2", uucore::execution_phrase())
|
||||
}
|
||||
|
||||
fn mkdelim(col: usize, opts: &ArgMatches) -> String {
|
||||
@@ -132,7 +129,7 @@ fn open_file(name: &str) -> io::Result<LineReader> {
|
||||
}
|
||||
|
||||
pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||
let usage = get_usage();
|
||||
let usage = usage();
|
||||
let args = args
|
||||
.collect_str(InvalidEncodingHandling::ConvertLossy)
|
||||
.accept_any();
|
||||
@@ -148,7 +145,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(uucore::util_name())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.after_help(LONG_HELP)
|
||||
|
||||
+6
-6
@@ -99,7 +99,7 @@ quick_error! {
|
||||
NotImplemented(opt: String) { display("Option '{}' not yet implemented.", opt) }
|
||||
|
||||
/// Invalid arguments to backup
|
||||
Backup(description: String) { display("{}\nTry 'cp --help' for more information.", description) }
|
||||
Backup(description: String) { display("{}\nTry '{} --help' for more information.", description, uucore::execution_phrase()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,12 +218,12 @@ static LONG_HELP: &str = "";
|
||||
static EXIT_OK: i32 = 0;
|
||||
static EXIT_ERR: i32 = 1;
|
||||
|
||||
fn get_usage() -> String {
|
||||
fn usage() -> String {
|
||||
format!(
|
||||
"{0} [OPTION]... [-T] SOURCE DEST
|
||||
{0} [OPTION]... SOURCE... DIRECTORY
|
||||
{0} [OPTION]... -t DIRECTORY SOURCE...",
|
||||
executable!()
|
||||
uucore::execution_phrase()
|
||||
)
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ static DEFAULT_ATTRIBUTES: &[Attribute] = &[
|
||||
];
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(uucore::util_name())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(Arg::with_name(options::TARGET_DIRECTORY)
|
||||
@@ -465,7 +465,7 @@ pub fn uu_app() -> App<'static, 'static> {
|
||||
}
|
||||
|
||||
pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||
let usage = get_usage();
|
||||
let usage = usage();
|
||||
let matches = uu_app()
|
||||
.after_help(&*format!(
|
||||
"{}\n{}",
|
||||
@@ -1060,7 +1060,7 @@ impl OverwriteMode {
|
||||
match *self {
|
||||
OverwriteMode::NoClobber => Err(Error::NotAllFilesCopied),
|
||||
OverwriteMode::Interactive(_) => {
|
||||
if prompt_yes!("{}: overwrite {}? ", executable!(), path.display()) {
|
||||
if prompt_yes!("{}: overwrite {}? ", uucore::util_name(), path.display()) {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(Error::Skipped(format!(
|
||||
|
||||
@@ -34,8 +34,11 @@ mod options {
|
||||
pub const PATTERN: &str = "pattern";
|
||||
}
|
||||
|
||||
fn get_usage() -> String {
|
||||
format!("{0} [OPTION]... FILE PATTERN...", executable!())
|
||||
fn usage() -> String {
|
||||
format!(
|
||||
"{0} [OPTION]... FILE PATTERN...",
|
||||
uucore::execution_phrase()
|
||||
)
|
||||
}
|
||||
|
||||
/// Command line options for csplit.
|
||||
@@ -706,7 +709,7 @@ mod tests {
|
||||
}
|
||||
|
||||
pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||
let usage = get_usage();
|
||||
let usage = usage();
|
||||
let args = args
|
||||
.collect_str(InvalidEncodingHandling::Ignore)
|
||||
.accept_any();
|
||||
@@ -739,7 +742,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(uucore::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(uucore::util_name())
|
||||
.name(NAME)
|
||||
.version(crate_version!())
|
||||
.usage(SYNTAX)
|
||||
|
||||
@@ -8,9 +8,6 @@
|
||||
|
||||
// spell-checker:ignore (chrono) Datelike Timelike ; (format) DATEFILE MMDDhhmm ; (vars) datetime datetimes
|
||||
|
||||
#[macro_use]
|
||||
extern crate uucore;
|
||||
|
||||
use chrono::{DateTime, FixedOffset, Local, Offset, Utc};
|
||||
#[cfg(windows)]
|
||||
use chrono::{Datelike, Timelike};
|
||||
@@ -253,7 +250,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(uucore::util_name())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
||||
+1
-3
@@ -7,8 +7,6 @@
|
||||
|
||||
// spell-checker:ignore fname, tname, fpath, specfile, testfile, unspec, ifile, ofile, outfile, fullblock, urand, fileio, atoe, atoibm, behaviour, bmax, bremain, btotal, cflags, creat, ctable, ctty, datastructures, doesnt, etoa, fileout, fname, gnudd, iconvflags, nocache, noctty, noerror, nofollow, nolinks, nonblock, oconvflags, outfile, parseargs, rlen, rmax, rposition, rremain, rsofar, rstat, sigusr, sigval, wlen, wstat
|
||||
|
||||
#[macro_use]
|
||||
extern crate uucore;
|
||||
use uucore::InvalidEncodingHandling;
|
||||
|
||||
#[cfg(test)]
|
||||
@@ -956,7 +954,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||
}
|
||||
|
||||
pub fn uu_app() -> clap::App<'static, 'static> {
|
||||
clap::App::new(executable!())
|
||||
clap::App::new(uucore::util_name())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
||||
+5
-5
@@ -79,8 +79,8 @@ struct Filesystem {
|
||||
usage: FsUsage,
|
||||
}
|
||||
|
||||
fn get_usage() -> String {
|
||||
format!("{0} [OPTION]... [FILE]...", executable!())
|
||||
fn usage() -> String {
|
||||
format!("{0} [OPTION]... [FILE]...", uucore::execution_phrase())
|
||||
}
|
||||
|
||||
impl FsSelector {
|
||||
@@ -284,7 +284,7 @@ impl UError for DfError {
|
||||
|
||||
#[uucore_procs::gen_uumain]
|
||||
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||
let usage = get_usage();
|
||||
let usage = usage();
|
||||
let matches = uu_app().usage(&usage[..]).get_matches_from(args);
|
||||
|
||||
let paths: Vec<String> = matches
|
||||
@@ -295,7 +295,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||
#[cfg(windows)]
|
||||
{
|
||||
if matches.is_present(OPT_INODES) {
|
||||
println!("{}: doesn't support -i option", executable!());
|
||||
println!("{}: doesn't support -i option", uucore::util_name());
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
@@ -427,7 +427,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||
}
|
||||
|
||||
pub fn uu_app() -> App<'static, 'static> {
|
||||
App::new(executable!())
|
||||
App::new(uucore::util_name())
|
||||
.version(crate_version!())
|
||||
.about(ABOUT)
|
||||
.arg(
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user