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

#41 in Command-line interface

Download history 42498/week @ 2024-08-15 46636/week @ 2024-08-22 48978/week @ 2024-08-29 50026/week @ 2024-09-05 48399/week @ 2024-09-12 44512/week @ 2024-09-19 41093/week @ 2024-09-26 53209/week @ 2024-10-03 47091/week @ 2024-10-10 49737/week @ 2024-10-17 50681/week @ 2024-10-24 48912/week @ 2024-10-31 47358/week @ 2024-11-07 44734/week @ 2024-11-14 40509/week @ 2024-11-21 32861/week @ 2024-11-28

176,581 downloads per month
Used in 37 crates (32 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