1
Fork 0
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:
Sylvestre Ledru 2023-03-24 22:55:49 +01:00 committed by GitHub
commit cd7d9b721d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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.