mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 12:37:49 +00:00
logname: fix test & style warning
This commit is contained in:
parent
41eb930292
commit
34b9809223
1 changed files with 3 additions and 4 deletions
|
@ -37,21 +37,20 @@ static SUMMARY: &str = "Print user's login name";
|
||||||
static VERSION: &str = env!("CARGO_PKG_VERSION");
|
static VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||||
|
|
||||||
fn get_usage() -> String {
|
fn get_usage() -> String {
|
||||||
format!("{0}", executable!())
|
String::from(executable!())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn uumain(args: impl uucore::Args) -> i32 {
|
pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||||
let _ = args
|
let args = args
|
||||||
.collect_str(InvalidEncodingHandling::Ignore)
|
.collect_str(InvalidEncodingHandling::Ignore)
|
||||||
.accept_any();
|
.accept_any();
|
||||||
|
|
||||||
let usage = get_usage();
|
let usage = get_usage();
|
||||||
|
|
||||||
let _ = App::new(executable!())
|
let _ = App::new(executable!())
|
||||||
.version(VERSION)
|
.version(VERSION)
|
||||||
.about(SUMMARY)
|
.about(SUMMARY)
|
||||||
.usage(&usage[..])
|
.usage(&usage[..])
|
||||||
.get_matches();
|
.get_matches_from(args);
|
||||||
|
|
||||||
match get_userlogin() {
|
match get_userlogin() {
|
||||||
Some(userlogin) => println!("{}", userlogin),
|
Some(userlogin) => println!("{}", userlogin),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue