mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
numfmt: update help to markdown syntax
This commit is contained in:
parent
bcf3b852c6
commit
b632ba8ff6
2 changed files with 25 additions and 25 deletions
|
@ -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.
|
||||
|
|
|
@ -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<Item = &'a str>, 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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue