Skip to content

Commit e8575fe

Browse files
committed
protest util name against binary name
1 parent ff6dd99 commit e8575fe

95 files changed

Lines changed: 97 additions & 93 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/bin/coreutils.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ fn main() {
8888
process::exit(0);
8989
}
9090
"--version" | "-V" => {
91-
println!("{binary_as_util} {VERSION} (multi-call binary)");
91+
// protect name against argv0
92+
println!("coreutils {VERSION} (multi-call binary)");
9293
process::exit(0);
9394
}
9495
// Not a special command: fallthrough to calling a util

src/uu/arch/src/arch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
2121
}
2222

2323
pub fn uu_app() -> Command {
24-
Command::new(uucore::util_name())
24+
Command::new("arch")
2525
.version(uucore::crate_version!())
2626
.help_template(uucore::localized_help_template(uucore::util_name()))
2727
.about(translate!("arch-about"))

src/uu/base32/src/base_common.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ pub fn parse_base_cmd_args(args: impl uucore::Args, command: Command) -> UResult
104104
}
105105

106106
pub fn base_app(about: String, usage: String) -> Command {
107+
//todo: name should not be binary name
107108
let cmd = Command::new(uucore::util_name())
108109
.version(uucore::crate_version!())
109110
.about(about)

src/uu/basename/src/basename.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
8080
}
8181

8282
pub fn uu_app() -> Command {
83-
Command::new(uucore::util_name())
83+
Command::new("basename")
8484
.version(uucore::crate_version!())
8585
.help_template(uucore::localized_help_template(uucore::util_name()))
8686
.about(translate!("basename-about"))

src/uu/cat/src/cat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
268268
}
269269

270270
pub fn uu_app() -> Command {
271-
Command::new(uucore::util_name())
271+
Command::new("cat")
272272
.version(uucore::crate_version!())
273273
.override_usage(format_usage(&translate!("cat-usage")))
274274
.about(translate!("cat-about"))

src/uu/chcon/src/chcon.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
156156
}
157157

158158
pub fn uu_app() -> Command {
159-
let cmd = Command::new(uucore::util_name())
159+
let cmd = Command::new("chcon")
160160
.version(uucore::crate_version!())
161161
.about(translate!("chcon-about"))
162162
.override_usage(format_usage(&translate!("chcon-usage")))

src/uu/chgrp/src/chgrp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
9898
}
9999

100100
pub fn uu_app() -> Command {
101-
let cmd = Command::new(uucore::util_name())
101+
let cmd = Command::new("chgrp")
102102
.version(uucore::crate_version!())
103103
.about(translate!("chgrp-about"))
104104
.override_usage(format_usage(&translate!("chgrp-usage")))

src/uu/chmod/src/chmod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
175175
}
176176

177177
pub fn uu_app() -> Command {
178-
Command::new(uucore::util_name())
178+
Command::new("chmod")
179179
.version(uucore::crate_version!())
180180
.about(translate!("chmod-about"))
181181
.override_usage(format_usage(&translate!("chmod-usage")))

src/uu/chown/src/chown.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
7575
}
7676

7777
pub fn uu_app() -> Command {
78-
Command::new(uucore::util_name())
78+
Command::new("chown")
7979
.version(uucore::crate_version!())
8080
.help_template(uucore::localized_help_template(uucore::util_name()))
8181
.about(translate!("chown-about"))

src/uu/chroot/src/chroot.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
220220
}
221221

222222
pub fn uu_app() -> Command {
223-
let cmd = Command::new(uucore::util_name())
223+
let cmd = Command::new("chroot")
224224
.version(uucore::crate_version!())
225225
.about(translate!("chroot-about"))
226226
.override_usage(format_usage(&translate!("chroot-usage")))

0 commit comments

Comments
 (0)