diff --git a/src/uu/basenc/src/basenc.rs b/src/uu/basenc/src/basenc.rs index e1daea4e6..ef9779512 100644 --- a/src/uu/basenc/src/basenc.rs +++ b/src/uu/basenc/src/basenc.rs @@ -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]", 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(&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 = 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 diff --git a/src/uu/cat/src/cat.rs b/src/uu/cat/src/cat.rs index cb12830a4..e0c7d2226 100644 --- a/src/uu/cat/src/cat.rs +++ b/src/uu/cat/src/cat.rs @@ -396,7 +396,7 @@ fn cat_files(files: Vec, options: &OutputOptions) -> UResult<()> { Ok(()) } else { // each next line is expected to display "cat: …" - let line_joiner = format!("\n{}: ", executable!()); + let line_joiner = format!("\n{}: ", util_name!()); Err(uucore::error::USimpleError::new( error_messages.len() as i32, diff --git a/src/uu/chcon/src/chcon.rs b/src/uu/chcon/src/chcon.rs index 2a5efba46..6f45dcd92 100644 --- a/src/uu/chcon/src/chcon.rs +++ b/src/uu/chcon/src/chcon.rs @@ -2,7 +2,7 @@ #![allow(clippy::upper_case_acronyms)] -use uucore::{executable, show_error, show_usage_error, show_warning}; +use uucore::{execution_phrase, show_error, show_usage_error, show_warning, util_name}; 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!() + 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(util_name!()) .version(VERSION) .about(ABOUT) .arg( @@ -563,7 +563,7 @@ fn process_file( if options.verbose { println!( "{}: Changing security context of: {}", - executable!(), + util_name!(), file_full_name.to_string_lossy() ); } diff --git a/src/uu/dd/src/dd.rs b/src/uu/dd/src/dd.rs index b300dff2d..660f62f7a 100644 --- a/src/uu/dd/src/dd.rs +++ b/src/uu/dd/src/dd.rs @@ -1046,7 +1046,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) .arg(