mirror of
https://github.com/nushell/nushell
synced 2025-01-13 13:49:21 +00:00
Fixed optional and required argument in signature.
This fixes issues like #1117
This commit is contained in:
parent
f9da7f7d58
commit
7ce1ddc6fd
1 changed files with 3 additions and 3 deletions
|
@ -17,9 +17,9 @@ macro_rules! signature {
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! positional {
|
macro_rules! positional {
|
||||||
($ident:tt, $name:tt (optional $shape:tt) - $desc:tt) => {
|
($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);
|
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);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue