mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
logname: move help strings to markdown file
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
# logname
|
||||
|
||||
```
|
||||
logname
|
||||
```
|
||||
|
||||
Print user's login name
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
use clap::{crate_version, Command};
|
||||
use std::ffi::CStr;
|
||||
use uucore::{error::UResult, show_error};
|
||||
use uucore::{error::UResult, format_usage, help_about, help_usage, show_error};
|
||||
|
||||
extern "C" {
|
||||
// POSIX requires using getlogin (or equivalent code)
|
||||
@@ -29,7 +29,8 @@ fn get_userlogin() -> Option<String> {
|
||||
}
|
||||
}
|
||||
|
||||
static ABOUT: &str = "Print user's login name";
|
||||
const ABOUT: &str = help_about!("logname.md");
|
||||
const USAGE: &str = help_usage!("logname.md");
|
||||
|
||||
#[uucore::main]
|
||||
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||
@@ -48,7 +49,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||
pub fn uu_app() -> Command {
|
||||
Command::new(uucore::util_name())
|
||||
.version(crate_version!())
|
||||
.override_usage(uucore::execution_phrase())
|
||||
.override_usage(format_usage(USAGE))
|
||||
.about(ABOUT)
|
||||
.infer_long_args(true)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user