Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/uu/arch/src/arch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
}

pub fn uu_app() -> Command {
Command::new(uucore::util_name())
Command::new("arch")
.version(uucore::crate_version!())
.help_template(uucore::localized_help_template(uucore::util_name()))
.help_template(uucore::localized_help_template("arch"))
.about(translate!("arch-about"))
.after_help(translate!("arch-after-help"))
.override_usage(translate!("arch-usage"))
Expand Down
4 changes: 2 additions & 2 deletions src/uu/basename/src/basename.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
}

pub fn uu_app() -> Command {
Command::new(uucore::util_name())
Command::new("basename")
.version(uucore::crate_version!())
.help_template(uucore::localized_help_template(uucore::util_name()))
.help_template(uucore::localized_help_template("basename"))
.about(translate!("basename-about"))
.override_usage(format_usage(&translate!("basename-usage")))
.infer_long_args(true)
Expand Down
8 changes: 4 additions & 4 deletions src/uu/cat/src/cat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,11 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
}

pub fn uu_app() -> Command {
Command::new(uucore::util_name())
Command::new("cat")
.version(uucore::crate_version!())
.override_usage(format_usage(&translate!("cat-usage")))
.about(translate!("cat-about"))
.help_template(uucore::localized_help_template(uucore::util_name()))
.help_template(uucore::localized_help_template("cat"))
.infer_long_args(true)
.args_override_self(true)
.arg(
Expand Down Expand Up @@ -420,11 +420,11 @@ where
Ok(())
} else {
// each next line is expected to display "cat: …"
let line_joiner = format!("\n{}: ", uucore::util_name());
let line_joiner = "\ncat: ";

Err(uucore::error::USimpleError::new(
error_messages.len() as i32,
error_messages.join(&line_joiner),
error_messages.join(line_joiner),
))
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/uu/chcon/src/chcon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
}

pub fn uu_app() -> Command {
let cmd = Command::new(uucore::util_name())
let cmd = Command::new("chcon")
.version(uucore::crate_version!())
.about(translate!("chcon-about"))
.override_usage(format_usage(&translate!("chcon-usage")))
Expand Down Expand Up @@ -613,7 +613,7 @@ fn process_file(
if options.verbose {
println!(
"{}",
translate!("chcon-verbose-changing-context", "util_name" => uucore::util_name(), "file" => file_full_name.quote())
translate!("chcon-verbose-changing-context", "util_name" => "chcon", "file" => file_full_name.quote())
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/uu/chgrp/src/chgrp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
}

pub fn uu_app() -> Command {
let cmd = Command::new(uucore::util_name())
let cmd = Command::new("chgrp")
.version(uucore::crate_version!())
.about(translate!("chgrp-about"))
.override_usage(format_usage(&translate!("chgrp-usage")))
Expand Down
4 changes: 2 additions & 2 deletions src/uu/chmod/src/chmod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
}

pub fn uu_app() -> Command {
Command::new(uucore::util_name())
Command::new("chmod")
.version(uucore::crate_version!())
.about(translate!("chmod-about"))
.override_usage(format_usage(&translate!("chmod-usage")))
.help_template(uucore::localized_help_template(uucore::util_name()))
.help_template(uucore::localized_help_template("chmod"))
.args_override_self(true)
.infer_long_args(true)
.no_binary_name(true)
Expand Down
4 changes: 2 additions & 2 deletions src/uu/chown/src/chown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
}

pub fn uu_app() -> Command {
Command::new(uucore::util_name())
Command::new("chown")
.version(uucore::crate_version!())
.help_template(uucore::localized_help_template(uucore::util_name()))
.help_template(uucore::localized_help_template("chown"))
.about(translate!("chown-about"))
.override_usage(format_usage(&translate!("chown-usage")))
.infer_long_args(true)
Expand Down
2 changes: 1 addition & 1 deletion src/uu/chroot/src/chroot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
}

pub fn uu_app() -> Command {
let cmd = Command::new(uucore::util_name())
let cmd = Command::new("chroot")
.version(uucore::crate_version!())
.about(translate!("chroot-about"))
.override_usage(format_usage(&translate!("chroot-usage")))
Expand Down
4 changes: 2 additions & 2 deletions src/uu/comm/src/comm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,9 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
}

pub fn uu_app() -> Command {
Command::new(uucore::util_name())
Command::new("comm")
.version(uucore::crate_version!())
.help_template(uucore::localized_help_template(uucore::util_name()))
.help_template(uucore::localized_help_template("comm"))
.about(translate!("comm-about"))
.override_usage(format_usage(&translate!("comm-usage")))
.infer_long_args(true)
Expand Down
4 changes: 2 additions & 2 deletions src/uu/cp/src/cp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ pub fn uu_app() -> Command {
options::ATTRIBUTES_ONLY,
options::COPY_CONTENTS,
];
Command::new(uucore::util_name())
Command::new("cp")
.version(uucore::crate_version!())
.about(translate!("cp-about"))
.help_template(uucore::localized_help_template(uucore::util_name()))
Expand Down Expand Up @@ -1404,7 +1404,7 @@ pub fn copy(sources: &[PathBuf], target: &Path, options: &Options) -> CopyResult
)
.unwrap(),
)
.with_message(uucore::util_name());
.with_message("cp");
pb.tick();
Some(pb)
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/uu/csplit/src/csplit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
}

pub fn uu_app() -> Command {
Command::new(uucore::util_name())
Command::new("csplit")
.version(uucore::crate_version!())
.help_template(uucore::localized_help_template(uucore::util_name()))
.about(translate!("csplit-about"))
Expand Down
2 changes: 1 addition & 1 deletion src/uu/cut/src/cut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
}

pub fn uu_app() -> Command {
Command::new(uucore::util_name())
Command::new("cut")
.version(uucore::crate_version!())
.help_template(uucore::localized_help_template(uucore::util_name()))
.override_usage(format_usage(&translate!("cut-usage")))
Expand Down
2 changes: 1 addition & 1 deletion src/uu/date/src/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
}

pub fn uu_app() -> Command {
Command::new(uucore::util_name())
Command::new("date")
.version(uucore::crate_version!())
.help_template(uucore::localized_help_template(uucore::util_name()))
.about(translate!("date-about"))
Expand Down
2 changes: 1 addition & 1 deletion src/uu/dd/src/dd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1535,7 +1535,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
}

pub fn uu_app() -> Command {
Command::new(uucore::util_name())
Command::new("dd")
.version(uucore::crate_version!())
.help_template(uucore::localized_help_template(uucore::util_name()))
.about(translate!("dd-about"))
Expand Down
6 changes: 3 additions & 3 deletions src/uu/df/src/df.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ enum OptionsError {
.0.iter()
.map(|t| translate!("df-error-filesystem-type-both-selected-and-excluded", "type" => t.quote()))
.collect::<Vec<_>>()
.join(format!("\n{}: ", uucore::util_name()).as_str())
.join("\ndf: ")
)]
FilesystemTypeBothSelectedAndExcluded(Vec<String>),
}
Expand Down Expand Up @@ -451,7 +451,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
if matches.get_flag(OPT_INODES) {
println!(
"{}",
translate!("df-error-inodes-not-supported-windows", "program" => uucore::util_name())
translate!("df-error-inodes-not-supported-windows", "program" => "df")
);
return Ok(());
}
Expand Down Expand Up @@ -498,7 +498,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
}

pub fn uu_app() -> Command {
Command::new(uucore::util_name())
Command::new("df")
.version(uucore::crate_version!())
.help_template(uucore::localized_help_template(uucore::util_name()))
.about(translate!("df-about"))
Expand Down
4 changes: 2 additions & 2 deletions src/uu/dircolors/src/dircolors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,9 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
}

pub fn uu_app() -> Command {
Command::new(uucore::util_name())
Command::new("dircolors")
.version(uucore::crate_version!())
.help_template(uucore::localized_help_template(uucore::util_name()))
.help_template(uucore::localized_help_template("dircolors"))
.about(translate!("dircolors-about"))
.after_help(translate!("dircolors-after-help"))
.override_usage(format_usage(&translate!("dircolors-usage")))
Expand Down
4 changes: 2 additions & 2 deletions src/uu/dirname/src/dirname.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
}

pub fn uu_app() -> Command {
Command::new(uucore::util_name())
Command::new("dirname")
.about(translate!("dirname-about"))
.version(uucore::crate_version!())
.help_template(uucore::localized_help_template(uucore::util_name()))
.help_template(uucore::localized_help_template("dirname"))
.override_usage(format_usage(&translate!("dirname-usage")))
.args_override_self(true)
.infer_long_args(true)
Expand Down
2 changes: 1 addition & 1 deletion src/uu/du/src/du.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,7 @@ fn parse_depth(max_depth_str: Option<&str>, summarize: bool) -> UResult<Option<u
}

pub fn uu_app() -> Command {
Command::new(uucore::util_name())
Command::new("du")
.version(uucore::crate_version!())
.help_template(uucore::localized_help_template(uucore::util_name()))
.about(translate!("du-about"))
Expand Down
2 changes: 1 addition & 1 deletion src/uu/expand/src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {

pub fn uu_app() -> Command {
uucore::clap_localization::configure_localized_command(
Command::new(uucore::util_name())
Command::new("expand")
.version(uucore::crate_version!())
.about(translate!("expand-about"))
.override_usage(format_usage(&translate!("expand-usage"))),
Expand Down
11 changes: 3 additions & 8 deletions src/uu/expr/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ impl UError for ExprError {
}

pub fn uu_app() -> Command {
Command::new(uucore::util_name())
Command::new("expr")
.version(uucore::crate_version!())
.help_template(uucore::localized_help_template(uucore::util_name()))
.help_template(uucore::localized_help_template("expr"))
.about(translate!("expr-about"))
.override_usage(format_usage(&translate!("expr-usage")))
.after_help(translate!("expr-after-help"))
Expand Down Expand Up @@ -111,12 +111,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
if args.len() == 1 && args[0] == b"--help" {
uu_app().print_help()?;
} else if args.len() == 1 && args[0] == b"--version" {
writeln!(
stdout(),
"{} {}",
uucore::util_name(),
uucore::crate_version!()
)?;
writeln!(stdout(), "expr {}", uucore::crate_version!())?;
} else {
// The first argument may be "--" and should be be ignored.
let args = if !args.is_empty() && args[0] == b"--" {
Expand Down
2 changes: 1 addition & 1 deletion src/uu/factor/src/factor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
}

pub fn uu_app() -> Command {
Command::new(uucore::util_name())
Command::new("factor")
.version(uucore::crate_version!())
.help_template(uucore::localized_help_template(uucore::util_name()))
.about(translate!("factor-about"))
Expand Down
4 changes: 2 additions & 2 deletions src/uu/fmt/src/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,9 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
}

pub fn uu_app() -> Command {
Command::new(uucore::util_name())
Command::new("fmt")
.version(uucore::crate_version!())
.help_template(uucore::localized_help_template(uucore::util_name()))
.help_template(uucore::localized_help_template("fmt"))
.about(translate!("fmt-about"))
.override_usage(format_usage(&translate!("fmt-usage")))
.infer_long_args(true)
Expand Down
2 changes: 1 addition & 1 deletion src/uu/fold/src/fold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
}

pub fn uu_app() -> Command {
Command::new(uucore::util_name())
Command::new("fold")
.version(uucore::crate_version!())
.help_template(uucore::localized_help_template(uucore::util_name()))
.override_usage(format_usage(&translate!("fold-usage")))
Expand Down
4 changes: 2 additions & 2 deletions src/uu/groups/src/groups.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
}

pub fn uu_app() -> Command {
Command::new(uucore::util_name())
Command::new("groups")
.version(uucore::crate_version!())
.help_template(uucore::localized_help_template(uucore::util_name()))
.help_template(uucore::localized_help_template("groups"))
.about(translate!("groups-about"))
.override_usage(format_usage(&translate!("groups-usage")))
.infer_long_args(true)
Expand Down
4 changes: 2 additions & 2 deletions src/uu/head/src/head.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ impl UError for HeadError {
type HeadResult<T> = Result<T, HeadError>;

pub fn uu_app() -> Command {
Command::new(uucore::util_name())
Command::new("head")
.version(uucore::crate_version!())
.help_template(uucore::localized_help_template(uucore::util_name()))
.help_template(uucore::localized_help_template("head"))
.about(translate!("head-about"))
.override_usage(format_usage(&translate!("head-usage")))
.infer_long_args(true)
Expand Down
4 changes: 2 additions & 2 deletions src/uu/hostid/src/hostid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
}

pub fn uu_app() -> Command {
Command::new(uucore::util_name())
Command::new("hostid")
.version(uucore::crate_version!())
.help_template(uucore::localized_help_template(uucore::util_name()))
.help_template(uucore::localized_help_template("hostid"))
.about(translate!("hostid-about"))
.override_usage(format_usage(&translate!("hostid-usage")))
.infer_long_args(true)
Expand Down
2 changes: 1 addition & 1 deletion src/uu/hostname/src/hostname.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
}

pub fn uu_app() -> Command {
Command::new(uucore::util_name())
Command::new("hostname")
.version(uucore::crate_version!())
.help_template(uucore::localized_help_template(uucore::util_name()))
.about(translate!("hostname-about"))
Expand Down
4 changes: 2 additions & 2 deletions src/uu/id/src/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,9 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
}

pub fn uu_app() -> Command {
Command::new(uucore::util_name())
Command::new("id")
.version(uucore::crate_version!())
.help_template(uucore::localized_help_template(uucore::util_name()))
.help_template(uucore::localized_help_template("id"))
.about(translate!("id-about"))
.override_usage(format_usage(&translate!("id-usage")))
.infer_long_args(true)
Expand Down
6 changes: 3 additions & 3 deletions src/uu/install/src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub struct Behavior {

#[derive(Error, Debug)]
enum InstallError {
#[error("{}", translate!("install-error-dir-needs-arg", "util_name" => uucore::util_name()))]
#[error("{}", translate!("install-error-dir-needs-arg", "util_name" => "install"))]
DirNeedsArg,

#[error("{}", translate!("install-error-create-dir-failed", "path" => .0.quote()))]
Expand Down Expand Up @@ -193,9 +193,9 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
}

pub fn uu_app() -> Command {
Command::new(uucore::util_name())
Command::new("install")
.version(uucore::crate_version!())
.help_template(uucore::localized_help_template(uucore::util_name()))
.help_template(uucore::localized_help_template("install"))
.about(translate!("install-about"))
.override_usage(format_usage(&translate!("install-usage")))
.infer_long_args(true)
Expand Down
2 changes: 1 addition & 1 deletion src/uu/join/src/join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
}

pub fn uu_app() -> Command {
Command::new(uucore::util_name())
Command::new("join")
.version(uucore::crate_version!())
.help_template(uucore::localized_help_template(uucore::util_name()))
.about(translate!("join-about"))
Expand Down
Loading
Loading