1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 20:17:45 +00:00

logname: align profile

This commit is contained in:
Idan Attias 2021-05-06 11:06:38 +03:00 committed by Sylvestre Ledru
parent b24b9d501b
commit 41eb930292

View file

@ -13,6 +13,7 @@
extern crate uucore;
use std::ffi::CStr;
use uucore::InvalidEncodingHandling;
use clap::App;
@ -35,10 +36,21 @@ fn get_userlogin() -> Option<String> {
static SUMMARY: &str = "Print user's login name";
static VERSION: &str = env!("CARGO_PKG_VERSION");
pub fn uumain(_: impl uucore::Args) -> i32 {
fn get_usage() -> String {
format!("{0}", executable!())
}
pub fn uumain(args: impl uucore::Args) -> i32 {
let _ = args
.collect_str(InvalidEncodingHandling::Ignore)
.accept_any();
let usage = get_usage();
let _ = App::new(executable!())
.version(VERSION)
.about(SUMMARY)
.usage(&usage[..])
.get_matches();
match get_userlogin() {