mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 12:37:49 +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;
|
extern crate uucore;
|
||||||
|
|
||||||
use std::ffi::CStr;
|
use std::ffi::CStr;
|
||||||
|
use uucore::InvalidEncodingHandling;
|
||||||
|
|
||||||
use clap::App;
|
use clap::App;
|
||||||
|
|
||||||
|
@ -35,10 +36,21 @@ fn get_userlogin() -> Option<String> {
|
||||||
static SUMMARY: &str = "Print user's login name";
|
static SUMMARY: &str = "Print user's login name";
|
||||||
static VERSION: &str = env!("CARGO_PKG_VERSION");
|
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!())
|
let _ = App::new(executable!())
|
||||||
.version(VERSION)
|
.version(VERSION)
|
||||||
.about(SUMMARY)
|
.about(SUMMARY)
|
||||||
|
.usage(&usage[..])
|
||||||
.get_matches();
|
.get_matches();
|
||||||
|
|
||||||
match get_userlogin() {
|
match get_userlogin() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue