mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
Merge pull request #4805 from iambasanta/tr-move-help-strings-to-md-file
tr: move help string to markdown file
This commit is contained in:
commit
599e7a0645
2 changed files with 16 additions and 7 deletions
|
@ -13,17 +13,15 @@ use clap::{crate_version, Arg, ArgAction, Command};
|
||||||
use nom::AsBytes;
|
use nom::AsBytes;
|
||||||
use operation::{translate_input, Sequence, SqueezeOperation, TranslateOperation};
|
use operation::{translate_input, Sequence, SqueezeOperation, TranslateOperation};
|
||||||
use std::io::{stdin, stdout, BufReader, BufWriter};
|
use std::io::{stdin, stdout, BufReader, BufWriter};
|
||||||
use uucore::{format_usage, show};
|
use uucore::{format_usage, help_about, help_section, help_usage, show};
|
||||||
|
|
||||||
use crate::operation::DeleteOperation;
|
use crate::operation::DeleteOperation;
|
||||||
use uucore::display::Quotable;
|
use uucore::display::Quotable;
|
||||||
use uucore::error::{UResult, USimpleError, UUsageError};
|
use uucore::error::{UResult, USimpleError, UUsageError};
|
||||||
|
|
||||||
const ABOUT: &str = "Translate or delete characters";
|
const ABOUT: &str = help_about!("tr.md");
|
||||||
const USAGE: &str = "{} [OPTION]... SET1 [SET2]";
|
const AFTER_HELP: &str = help_section!("after help", "tr.md");
|
||||||
const LONG_USAGE: &str = "\
|
const USAGE: &str = help_usage!("tr.md");
|
||||||
Translate, squeeze, and/or delete characters from standard input, \
|
|
||||||
writing to standard output.";
|
|
||||||
|
|
||||||
mod options {
|
mod options {
|
||||||
pub const COMPLEMENT: &str = "complement";
|
pub const COMPLEMENT: &str = "complement";
|
||||||
|
@ -37,7 +35,7 @@ mod options {
|
||||||
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||||
let args = args.collect_lossy();
|
let args = args.collect_lossy();
|
||||||
|
|
||||||
let matches = uu_app().after_help(LONG_USAGE).try_get_matches_from(args)?;
|
let matches = uu_app().after_help(AFTER_HELP).try_get_matches_from(args)?;
|
||||||
|
|
||||||
let delete_flag = matches.get_flag(options::DELETE);
|
let delete_flag = matches.get_flag(options::DELETE);
|
||||||
let complement_flag = matches.get_flag(options::COMPLEMENT);
|
let complement_flag = matches.get_flag(options::COMPLEMENT);
|
||||||
|
|
11
src/uu/tr/tr.md
Normal file
11
src/uu/tr/tr.md
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
# tr
|
||||||
|
|
||||||
|
```
|
||||||
|
tr [OPTION]... SET1 [SET2]
|
||||||
|
```
|
||||||
|
|
||||||
|
Translate or delete characters
|
||||||
|
|
||||||
|
## After help
|
||||||
|
|
||||||
|
Translate, squeeze, and/or delete characters from standard input, writing to standard output.
|
Loading…
Add table
Add a link
Reference in a new issue