whoami: move help strings to markdown file

This commit is contained in:
Miles Liu 2023-03-16 17:57:00 +08:00
parent f53df8ade5
commit f623a7e13a
No known key found for this signature in database
GPG key ID: 4DB9B32F9B24A7A9
2 changed files with 11 additions and 1 deletions

View file

@ -11,10 +11,12 @@ use clap::{crate_version, Command};
use uucore::display::println_verbatim;
use uucore::error::{FromIo, UResult};
use uucore::{format_usage, help_about, help_usage};
mod platform;
static ABOUT: &str = "Print the current username.";
const ABOUT: &str = help_about!("whoami.md");
const USAGE: &str = help_usage!("whoami.md");
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
@ -28,5 +30,6 @@ pub fn uu_app() -> Command {
Command::new(uucore::util_name())
.version(crate_version!())
.about(ABOUT)
.override_usage(format_usage(USAGE))
.infer_long_args(true)
}

7
src/uu/whoami/whoami.md Normal file
View file

@ -0,0 +1,7 @@
# whoami
```
whoami
```
Print the current username.