mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 04:27:45 +00:00
Merge pull request #4519 from miles170/whoami-move-help-strings-to-md-file
whoami: move help strings to markdown file
This commit is contained in:
commit
5be450c925
2 changed files with 11 additions and 1 deletions
|
@ -11,10 +11,12 @@ use clap::{crate_version, Command};
|
||||||
|
|
||||||
use uucore::display::println_verbatim;
|
use uucore::display::println_verbatim;
|
||||||
use uucore::error::{FromIo, UResult};
|
use uucore::error::{FromIo, UResult};
|
||||||
|
use uucore::{format_usage, help_about, help_usage};
|
||||||
|
|
||||||
mod platform;
|
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]
|
#[uucore::main]
|
||||||
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||||
|
@ -28,5 +30,6 @@ pub fn uu_app() -> Command {
|
||||||
Command::new(uucore::util_name())
|
Command::new(uucore::util_name())
|
||||||
.version(crate_version!())
|
.version(crate_version!())
|
||||||
.about(ABOUT)
|
.about(ABOUT)
|
||||||
|
.override_usage(format_usage(USAGE))
|
||||||
.infer_long_args(true)
|
.infer_long_args(true)
|
||||||
}
|
}
|
||||||
|
|
7
src/uu/whoami/whoami.md
Normal file
7
src/uu/whoami/whoami.md
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# whoami
|
||||||
|
|
||||||
|
```
|
||||||
|
whoami
|
||||||
|
```
|
||||||
|
|
||||||
|
Print the current username.
|
Loading…
Add table
Add a link
Reference in a new issue