10 releases (5 stable)

1.1.1 Jan 22, 2024
1.1.0 Jan 21, 2024
1.0.2 Oct 8, 2022
1.0.0 Jan 1, 2022
0.1.2 Jul 30, 2020

#39 in Command-line interface

Download history 31085/week @ 2024-07-10 39636/week @ 2024-07-17 36577/week @ 2024-07-24 26057/week @ 2024-07-31 43741/week @ 2024-08-07 43550/week @ 2024-08-14 42812/week @ 2024-08-21 53649/week @ 2024-08-28 49133/week @ 2024-09-04 48577/week @ 2024-09-11 44518/week @ 2024-09-18 40545/week @ 2024-09-25 52854/week @ 2024-10-02 45714/week @ 2024-10-09 51959/week @ 2024-10-16 50164/week @ 2024-10-23

207,702 downloads per month
Used in 36 crates (31 directly)

MIT license

15KB
192 lines

crates.io docs.rs Build Status

clap-num

clap number parsers.

This crate contains functions to validate and parse numerical values from strings provided by clap.

  • maybe_hex Validates an unsigned integer value that can be base-10 or base-16.
  • maybe_hex_range Validates an unsigned integer value that can be base-10 or base-16 within a range.
  • number_range Validate a signed or unsigned integer value.
  • si_number Validate a signed or unsigned integer value with a metric prefix.
  • si_number_range Validate a signed or unsigned integer value with a metric prefix within a range.

lib.rs:

clap number parsers.

This crate contains functions to validate and parse numerical values from strings provided by clap.

  • maybe_hex Validates an unsigned integer value that can be base-10 or base-16.
  • maybe_hex_range Validates an unsigned integer value that can be base-10 or base-16 within a range.
  • number_range Validate a signed or unsigned integer value.
  • si_number Validate a signed or unsigned integer value with a metric prefix.
  • si_number_range Validate a signed or unsigned integer value with a metric prefix within a range.

Dependencies

~150KB