diff --git a/crates/nu-parser/src/parse_command.rs b/crates/nu-parser/src/parse_command.rs index 30e425872d..b52461df8e 100644 --- a/crates/nu-parser/src/parse_command.rs +++ b/crates/nu-parser/src/parse_command.rs @@ -54,6 +54,8 @@ pub fn parse_command_tail( Ok((pos, flag)) => { let result = expand_flag(tail, *syntax_type, flag, pos); + tail.move_to(0); + match result { Ok(expr) => { named.insert_mandatory(name, expr); @@ -78,6 +80,8 @@ pub fn parse_command_tail( Ok(Some((pos, flag))) => { let result = expand_flag(tail, *syntax_type, flag, pos); + tail.move_to(0); + match result { Ok(expr) => { named.insert_optional(name, Some(expr));