Parse a comma-separated pattern list, dropping blanks.
(raw: &str)
| 173 | |
| 174 | /// Parse a comma-separated pattern list, dropping blanks. |
| 175 | pub fn parse_patterns(raw: &str) -> Vec<String> { |
| 176 | raw.split(',') |
| 177 | .map(str::trim) |
| 178 | .filter(|s| !s.is_empty()) |
| 179 | .map(str::to_string) |
| 180 | .collect() |
| 181 | } |
| 182 | |
| 183 | /// Parse a duration like `30d`, `12h`, `90m`, or a bare number of days. |
| 184 | pub fn parse_duration(raw: &str) -> CliResult<Duration> { |
no test coverage detected