Add help flag support to alias (#3595)

This commit is contained in:
JT 2021-06-10 16:28:33 +12:00 committed by GitHub
parent d056bf070f
commit fadcdde7f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1994,6 +1994,10 @@ fn expand_shorthand_forms(
}
fn parse_alias(call: &LiteCommand, scope: &dyn ParserScope) -> Option<ParseError> {
if call.parts.len() == 2 && (call.parts[1].item == "--help" || (call.parts[1].item == "-h")) {
return None;
}
if call.parts.len() < 4 {
return Some(ParseError::mismatch("alias", call.parts[0].clone()));
}