mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 19:17:43 +00:00
Merge pull request #4566 from SSJDeathSpawn/main
fix: to show the name of utility instead of 'manpages'
This commit is contained in:
commit
cd7d9b721d
1 changed files with 5 additions and 7 deletions
|
@ -119,13 +119,11 @@ pub fn set_utility_is_second_arg() {
|
||||||
static ARGV: Lazy<Vec<OsString>> = Lazy::new(|| wild::args_os().collect());
|
static ARGV: Lazy<Vec<OsString>> = Lazy::new(|| wild::args_os().collect());
|
||||||
|
|
||||||
static UTIL_NAME: Lazy<String> = Lazy::new(|| {
|
static UTIL_NAME: Lazy<String> = Lazy::new(|| {
|
||||||
if get_utility_is_second_arg() {
|
let base_index = if get_utility_is_second_arg() { 1 } else { 0 };
|
||||||
&ARGV[1]
|
let is_man = if ARGV[base_index].eq("manpage") { 1 } else { 0 };
|
||||||
} else {
|
let argv_index = base_index + is_man;
|
||||||
&ARGV[0]
|
|
||||||
}
|
ARGV[argv_index].to_string_lossy().into_owned()
|
||||||
.to_string_lossy()
|
|
||||||
.into_owned()
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/// Derive the utility name.
|
/// Derive the utility name.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue