From f20a4a42e818a9a515136655ece240d358f4d2cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20N=2E=20Robalino?= Date: Tue, 28 Jan 2020 01:03:28 -0500 Subject: [PATCH] Let's the expander look for tokens from start. (#1293) --- crates/nu-parser/src/parse_command.rs | 4 ++++ 1 file changed, 4 insertions(+) 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));