From b632ba8ff64fd0dd2add5124ed774ca0590bdf1a Mon Sep 17 00:00:00 2001 From: Terts Diepraam Date: Fri, 18 Nov 2022 16:01:18 +0100 Subject: [PATCH] numfmt: update help to markdown syntax --- src/uu/numfmt/numfmt.md | 46 ++++++++++++++++++------------------- src/uu/numfmt/src/numfmt.rs | 4 ++-- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/uu/numfmt/numfmt.md b/src/uu/numfmt/numfmt.md index 52bd743d8..3216d6eb7 100644 --- a/src/uu/numfmt/numfmt.md +++ b/src/uu/numfmt/numfmt.md @@ -10,38 +10,38 @@ numfmt [OPTION]... [NUMBER]... Convert numbers from/to human-readable strings -## Long Help +## After Help -UNIT options: - none no auto-scaling is done; suffixes will trigger an error +`UNIT` options: + - `none`: no auto-scaling is done; suffixes will trigger an error + - `auto`: accept optional single/two letter suffix: - auto accept optional single/two letter suffix: + 1K = 1000, 1Ki = 1024, 1M = 1000000, 1Mi = 1048576, - 1K = 1000, 1Ki = 1024, 1M = 1000000, 1Mi = 1048576, + - `si`: accept optional single letter suffix: - si accept optional single letter suffix: + 1K = 1000, 1M = 1000000, ... - 1K = 1000, 1M = 1000000, ... + - `iec`: accept optional single letter suffix: - iec accept optional single letter suffix: + 1K = 1024, 1M = 1048576, ... - 1K = 1024, 1M = 1048576, ... +- `iec-i`: accept optional two-letter suffix: - iec-i accept optional two-letter suffix: + 1Ki = 1024, 1Mi = 1048576, ... - 1Ki = 1024, 1Mi = 1048576, ... +`FIELDS` supports `cut(1)` style field ranges: + + N N'th field, counted from 1 + N- from N'th field, to end of line + N-M from N'th to M'th field (inclusive) + -M from first to M'th field (inclusive) + - all fields -FIELDS supports cut(1) style field ranges: - N N'th field, counted from 1 - N- from N'th field, to end of line - N-M from N'th to M'th field (inclusive) - -M from first to M'th field (inclusive) - - all fields Multiple fields/ranges can be separated with commas -FORMAT must be suitable for printing one floating-point argument '%f'. -Optional quote (%'f) will enable --grouping (if supported by current locale). -Optional width value (%10f) will pad output. Optional zero (%010f) width -will zero pad the number. Optional negative values (%-10f) will left align. -Optional precision (%.1f) will override the input determined precision. - +`FORMAT` must be suitable for printing one floating-point argument `%f`. +Optional quote (`%'f`) will enable --grouping (if supported by current locale). +Optional width value (`%10f`) will pad output. Optional zero (`%010f`) width +will zero pad the number. Optional negative values (`%-10f`) will left align. +Optional precision (`%.1f`) will override the input determined precision. diff --git a/src/uu/numfmt/src/numfmt.rs b/src/uu/numfmt/src/numfmt.rs index 1e826e68e..80b604e6d 100644 --- a/src/uu/numfmt/src/numfmt.rs +++ b/src/uu/numfmt/src/numfmt.rs @@ -24,7 +24,7 @@ pub mod options; mod units; const ABOUT: &str = help_section!("about", "numfmt.md"); -const LONG_HELP: &str = help_section!("long help", "numfmt.md"); +const AFTER_HELP: &str = help_section!("after help", "numfmt.md"); const USAGE: &str = help_usage!("numfmt.md"); fn handle_args<'a>(args: impl Iterator, options: &NumfmtOptions) -> UResult<()> { @@ -262,7 +262,7 @@ pub fn uu_app() -> Command { Command::new(uucore::util_name()) .version(crate_version!()) .about(ABOUT) - .after_help(LONG_HELP) + .after_help(AFTER_HELP) .override_usage(format_usage(USAGE)) .allow_negative_numbers(true) .infer_long_args(true)