nushell/crates/nu-engine
Leonhard Kipp 71b99edd48
parser/add rest args to def (#2961)
* Add rest arg to def

This commit applied adds the ability to define the rest parameter of a def
command. It does not implement the functionality to expand the rest argument in
a user defined def function.

The rest argument has to be exactly worded "...rest".

Example after this PR is applied:

file test.nu
```shell
def my_command [
    ...rest:int # My rest arg
] {
    echo 1 2 3
}
```

```shell
> source test.nu
> my_command -h
Usage:
  > my_command ...args {flags}

Parameters:
  ...args: My rest arg

Flags:
  -h, --help: Display this help message
```

* Fix space in help on wrong side
2021-01-23 07:13:29 +13:00
..
src parser/add rest args to def (#2961) 2021-01-23 07:13:29 +13:00
tests Fix bug #2921 (#2945) 2021-01-21 07:58:37 +13:00
Cargo.toml Replace dirs and directories with maintained (#2949) 2021-01-19 14:24:27 -06:00