mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-01 05:27:45 +00:00
Merge pull request #4681 from miles170/uniq-move-help-strings-to-md-fil
uniq: move help strings to markdown file
This commit is contained in:
commit
297a6b4465
2 changed files with 20 additions and 9 deletions
|
@ -12,15 +12,11 @@ use std::path::Path;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use uucore::display::Quotable;
|
use uucore::display::Quotable;
|
||||||
use uucore::error::{FromIo, UResult, USimpleError, UUsageError};
|
use uucore::error::{FromIo, UResult, USimpleError, UUsageError};
|
||||||
use uucore::format_usage;
|
use uucore::{format_usage, help_about, help_section, help_usage};
|
||||||
|
|
||||||
const ABOUT: &str = "Report or omit repeated lines.";
|
const ABOUT: &str = help_about!("uniq.md");
|
||||||
const USAGE: &str = "{} [OPTION]... [INPUT [OUTPUT]]...";
|
const USAGE: &str = help_usage!("uniq.md");
|
||||||
const LONG_USAGE: &str = "\
|
const AFTER_HELP: &str = help_section!("after help", "uniq.md");
|
||||||
Filter adjacent matching lines from INPUT (or standard input),\n\
|
|
||||||
writing to OUTPUT (or standard output).\n\n\
|
|
||||||
Note: 'uniq' does not detect repeated lines unless they are adjacent.\n\
|
|
||||||
You may want to sort the input first, or use 'sort -u' without 'uniq'.";
|
|
||||||
|
|
||||||
pub mod options {
|
pub mod options {
|
||||||
pub static ALL_REPEATED: &str = "all-repeated";
|
pub static ALL_REPEATED: &str = "all-repeated";
|
||||||
|
@ -247,7 +243,7 @@ fn opt_parsed<T: FromStr>(opt_name: &str, matches: &ArgMatches) -> UResult<Optio
|
||||||
|
|
||||||
#[uucore::main]
|
#[uucore::main]
|
||||||
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||||
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 files: Vec<String> = matches
|
let files: Vec<String> = matches
|
||||||
.get_many::<String>(ARG_FILES)
|
.get_many::<String>(ARG_FILES)
|
||||||
|
|
15
src/uu/uniq/uniq.md
Normal file
15
src/uu/uniq/uniq.md
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
# uniq
|
||||||
|
|
||||||
|
```
|
||||||
|
uniq [OPTION]... [INPUT [OUTPUT]]...
|
||||||
|
```
|
||||||
|
|
||||||
|
Report or omit repeated lines.
|
||||||
|
|
||||||
|
## After help
|
||||||
|
|
||||||
|
Filter adjacent matching lines from `INPUT` (or standard input),
|
||||||
|
writing to `OUTPUT` (or standard output).
|
||||||
|
|
||||||
|
Note: `uniq` does not detect repeated lines unless they are adjacent.
|
||||||
|
You may want to sort the input first, or use `sort -u` without `uniq`.
|
Loading…
Add table
Add a link
Reference in a new issue