From fadcdde7f86cb2cf2795acf3e3dab28c77b32b4e Mon Sep 17 00:00:00 2001 From: JT Date: Thu, 10 Jun 2021 16:28:33 +1200 Subject: [PATCH] Add help flag support to alias (#3595) --- crates/nu-parser/src/parse.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/nu-parser/src/parse.rs b/crates/nu-parser/src/parse.rs index 84af2fe2d..0eedc444e 100644 --- a/crates/nu-parser/src/parse.rs +++ b/crates/nu-parser/src/parse.rs @@ -1994,6 +1994,10 @@ fn expand_shorthand_forms( } fn parse_alias(call: &LiteCommand, scope: &dyn ParserScope) -> Option { + 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())); }