echo: move help strings to markdown file

This commit is contained in:
IZUMI-Zu 2023-03-07 10:25:42 +08:00
parent 199978694a
commit c90c8ea214
2 changed files with 30 additions and 21 deletions

26
src/uu/echo/echo.md Normal file
View file

@ -0,0 +1,26 @@
# echo
```
echo [OPTIONS]... [STRING]...
```
Display a line of text
## After Help
Echo the STRING(s) to standard output.
If -e is in effect, the following sequences are recognized:
\\ backslash
\a alert (BEL)
\b backspace
\c produce no further output
\e escape
\f form feed
\n new line
\r carriage return
\t horizontal tab
\v vertical tab
\0NNN byte with octal value NNN (1 to 3 digits)
\xHH byte with hexadecimal value HH (1 to 2 digits)

View file

@ -11,28 +11,11 @@ use std::io::{self, Write};
use std::iter::Peekable; use std::iter::Peekable;
use std::str::Chars; use std::str::Chars;
use uucore::error::{FromIo, UResult}; use uucore::error::{FromIo, UResult};
use uucore::format_usage; use uucore::{format_usage, help_about, help_section, help_usage};
const ABOUT: &str = "Display a line of text"; const ABOUT: &str = help_about!("echo.md");
const USAGE: &str = "{} [OPTIONS]... [STRING]..."; const USAGE: &str = help_usage!("echo.md");
const AFTER_HELP: &str = r#" const AFTER_HELP: &str = help_section!("after help", "echo.md");
Echo the STRING(s) to standard output.
If -e is in effect, the following sequences are recognized:
\\\\ backslash
\\a alert (BEL)
\\b backspace
\\c produce no further output
\\e escape
\\f form feed
\\n new line
\\r carriage return
\\t horizontal tab
\\v vertical tab
\\0NNN byte with octal value NNN (1 to 3 digits)
\\xHH byte with hexadecimal value HH (1 to 2 digits)
"#;
mod options { mod options {
pub const STRING: &str = "STRING"; pub const STRING: &str = "STRING";