(err: &clap::Error, kind: ContextKind)
| 214 | } |
| 215 | |
| 216 | fn ctx_list(err: &clap::Error, kind: ContextKind) -> Vec<String> { |
| 217 | match err.get(kind) { |
| 218 | Some(ContextValue::Strings(v)) => v.clone(), |
| 219 | Some(ContextValue::String(s)) => vec![s.clone()], |
| 220 | Some(ContextValue::StyledStrs(v)) => v.iter().map(|s| s.to_string()).collect(), |
| 221 | Some(ContextValue::StyledStr(s)) => vec![s.to_string()], |
| 222 | _ => Vec::new(), |
| 223 | } |
| 224 | } |
| 225 | |
| 226 | fn ctx_number(err: &clap::Error, kind: ContextKind) -> Option<isize> { |
| 227 | match err.get(kind) { |