1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

Merge pull request #5070 from cakebaker/nl_after_help

nl: add "after help"
This commit is contained in:
Sylvestre Ledru 2023-07-11 15:01:16 +02:00 committed by GitHub
commit e339e53318
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 1 deletions

View file

@ -5,3 +5,19 @@ nl [OPTION]... [FILE]...
```
Number lines of files
## After Help
`STYLE` is one of:
* `a` number all lines
* `t` number only nonempty lines
* `n` number no lines
* `pBRE` number only lines that contain a match for the basic regular
expression, `BRE`
`FORMAT` is one of:
* `ln` left justified, no leading zeros
* `rn` right justified, no leading zeros
* `rz` right justified, leading zeros

View file

@ -12,11 +12,12 @@ use std::io::{stdin, BufRead, BufReader, Read};
use std::iter::repeat;
use std::path::Path;
use uucore::error::{FromIo, UResult, USimpleError};
use uucore::{format_usage, help_about, help_usage};
use uucore::{format_usage, help_about, help_section, help_usage};
mod helper;
const ABOUT: &str = help_about!("nl.md");
const AFTER_HELP: &str = help_section!("after help", "nl.md");
const USAGE: &str = help_usage!("nl.md");
// Settings store options used by nl to produce its output.
@ -146,6 +147,7 @@ pub fn uu_app() -> Command {
.about(ABOUT)
.version(crate_version!())
.override_usage(format_usage(USAGE))
.after_help(AFTER_HELP)
.infer_long_args(true)
.disable_help_flag(true)
.arg(