From 7ce1ddc6fdaa120c1033bf58c0ffded356563ccc Mon Sep 17 00:00:00 2001 From: Kevin Date: Thu, 26 Dec 2019 12:29:41 -0500 Subject: [PATCH] Fixed optional and required argument in signature. This fixes issues like #1117 --- crates/nu-macros/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/nu-macros/src/lib.rs b/crates/nu-macros/src/lib.rs index 0c323f9aa1..4f9b7552dd 100644 --- a/crates/nu-macros/src/lib.rs +++ b/crates/nu-macros/src/lib.rs @@ -17,9 +17,9 @@ macro_rules! signature { #[macro_export] macro_rules! positional { ($ident:tt, $name:tt (optional $shape:tt) - $desc:tt) => { - let $ident = $ident.required(stringify!($name), SyntaxShape::$shape, $desc); - }; - ($ident:tt, $name:tt ($shape:tt)- $desc:tt) => { let $ident = $ident.optional(stringify!($name), SyntaxShape::$shape, $desc); }; + ($ident:tt, $name:tt ($shape:tt)- $desc:tt) => { + let $ident = $ident.required(stringify!($name), SyntaxShape::$shape, $desc); + }; }