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:
parent
b24b9d501b
commit
41eb930292
1 changed files with 13 additions and 1 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue