From eb2123ee155cc2c126fd4590c28b784fc87b993a Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Tue, 11 Jul 2023 14:26:54 +0200 Subject: [PATCH] nl: add "after help" --- src/uu/nl/nl.md | 16 ++++++++++++++++ src/uu/nl/src/nl.rs | 4 +++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/uu/nl/nl.md b/src/uu/nl/nl.md index d7cfc698f..bf3952cb2 100644 --- a/src/uu/nl/nl.md +++ b/src/uu/nl/nl.md @@ -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 diff --git a/src/uu/nl/src/nl.rs b/src/uu/nl/src/nl.rs index ffb276f11..e9cd9b876 100644 --- a/src/uu/nl/src/nl.rs +++ b/src/uu/nl/src/nl.rs @@ -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(