nushell/crates/nu-source/src
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
..
lib.rs Bump a lot of deps (#1560) 2020-04-07 19:51:17 +12:00
meta.rs parser/add rest args to def (#2961) 2021-01-23 07:13:29 +13:00
pretty.rs Match cleanup (#2294) 2020-08-04 05:43:27 +12:00
term_colored.rs Extract nu_source into a crate 2019-11-25 07:37:33 -08:00
text.rs Fix new clippy warnings (#2760) 2020-11-22 13:37:16 +13:00