Function humble_cli::util::parse_usize_range
source · pub fn parse_usize_range(value: &str, max_value: usize) -> Option<Vec<usize>>Expand description
Parse the given usize range and return the values in that range as a Vector.
Value formats are:
- A single value: 42
- A range with beginning and end (1-5): Returns all valus between those two numbers (inclusive).
- A range with no end (10-): In this case,
max_valuespecifies the end of the range. - A range with no beginning (-5): In this case, the range begins at
1.
Note: the range starts at 1, not 0.