Fixed optional and required argument in signature.

This fixes issues like #1117
This commit is contained in:
Kevin 2019-12-26 12:29:41 -05:00
parent f9da7f7d58
commit 7ce1ddc6fd
No known key found for this signature in database
GPG Key ID: 73A2AF10B0FD9D7D

View File

@ -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);
};
}