forked from clap-rs/clap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(parser): Convenient range value parsers
There are several approaches with this - `value_parser(N..M)`: creates an i64 range - `value_parser(value_parser!(u16).range(10..))`: creates an u16 range that starts at 10 - `RangeI64ValueParser`: create whatever range you want I was hoping to generalize `RangeI64ValueParser` for any source type, not just i64, but ran into issues and decided to punt. I chose `i64` as the source type as it seemed the most general and didn't run into portability issues like `isize`. This is a step towards clap-rs#3199. All that is left is for the derive to use this.
- Loading branch information
Showing
3 changed files
with
485 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.