1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 12:07:46 +00:00

nl: add "after help"

This commit is contained in:
Daniel Hofstetter 2023-07-11 14:26:54 +02:00
parent bf30cbf4f6
commit eb2123ee15
2 changed files with 19 additions and 1 deletions

View file

@ -5,3 +5,19 @@ nl [OPTION]... [FILE]...
``` ```
Number lines of files 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::iter::repeat;
use std::path::Path; use std::path::Path;
use uucore::error::{FromIo, UResult, USimpleError}; 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; mod helper;
const ABOUT: &str = help_about!("nl.md"); const ABOUT: &str = help_about!("nl.md");
const AFTER_HELP: &str = help_section!("after help", "nl.md");
const USAGE: &str = help_usage!("nl.md"); const USAGE: &str = help_usage!("nl.md");
// Settings store options used by nl to produce its output. // Settings store options used by nl to produce its output.
@ -146,6 +147,7 @@ pub fn uu_app() -> Command {
.about(ABOUT) .about(ABOUT)
.version(crate_version!()) .version(crate_version!())
.override_usage(format_usage(USAGE)) .override_usage(format_usage(USAGE))
.after_help(AFTER_HELP)
.infer_long_args(true) .infer_long_args(true)
.disable_help_flag(true) .disable_help_flag(true)
.arg( .arg(