8 releases (3 stable)

1.0.2 Oct 8, 2022
1.0.1 Oct 7, 2022
1.0.0 Jan 1, 2022
0.2.0 Oct 18, 2020
0.1.2 Jul 30, 2020

#173 in Command-line interface

Download history 248/week @ 2022-10-14 275/week @ 2022-10-21 199/week @ 2022-10-28 289/week @ 2022-11-04 256/week @ 2022-11-11 172/week @ 2022-11-18 190/week @ 2022-11-25 197/week @ 2022-12-02 292/week @ 2022-12-09 259/week @ 2022-12-16 152/week @ 2022-12-23 137/week @ 2022-12-30 257/week @ 2023-01-06 246/week @ 2023-01-13 273/week @ 2023-01-20 257/week @ 2023-01-27

1,067 downloads per month
Used in 2 crates

MIT license

15KB
204 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

~155KB