nushell/crates
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
..
nu_plugin_binaryview Bump to 0.25.2 (#2908) 2021-01-12 07:50:53 +13:00
nu_plugin_chart Bump to 0.25.2 (#2908) 2021-01-12 07:50:53 +13:00
nu_plugin_fetch Bump to 0.25.2 (#2908) 2021-01-12 07:50:53 +13:00
nu_plugin_from_bson Bump to 0.25.2 (#2908) 2021-01-12 07:50:53 +13:00
nu_plugin_from_sqlite Bump to 0.25.2 (#2908) 2021-01-12 07:50:53 +13:00
nu_plugin_inc Bump to 0.25.2 (#2908) 2021-01-12 07:50:53 +13:00
nu_plugin_match Bump to 0.25.2 (#2908) 2021-01-12 07:50:53 +13:00
nu_plugin_post Bump to 0.25.2 (#2908) 2021-01-12 07:50:53 +13:00
nu_plugin_ps Temporarily(?) switch from heim+uom to sysinfo (#2954) 2021-01-20 20:18:38 +13:00
nu_plugin_s3 Bump to 0.25.2 (#2908) 2021-01-12 07:50:53 +13:00
nu_plugin_selector Bump to 0.25.2 (#2908) 2021-01-12 07:50:53 +13:00
nu_plugin_start Bump to 0.25.2 (#2908) 2021-01-12 07:50:53 +13:00
nu_plugin_sys Temporarily(?) switch from heim+uom to sysinfo (#2954) 2021-01-20 20:18:38 +13:00
nu_plugin_textview Bump to 0.25.2 (#2908) 2021-01-12 07:50:53 +13:00
nu_plugin_to_bson Bump to 0.25.2 (#2908) 2021-01-12 07:50:53 +13:00
nu_plugin_to_sqlite Bump to 0.25.2 (#2908) 2021-01-12 07:50:53 +13:00
nu_plugin_tree Bump to 0.25.2 (#2908) 2021-01-12 07:50:53 +13:00
nu_plugin_xpath Bump to 0.25.2 (#2908) 2021-01-12 07:50:53 +13:00
nu-cli Temporarily(?) switch from heim+uom to sysinfo (#2954) 2021-01-20 20:18:38 +13:00
nu-command Clean up and refactoring examples tests. (#2957) 2021-01-20 21:07:16 -05:00
nu-data Replace dirs and directories with maintained (#2949) 2021-01-19 14:24:27 -06:00
nu-engine parser/add rest args to def (#2961) 2021-01-23 07:13:29 +13:00
nu-errors Bump to 0.25.2 (#2908) 2021-01-12 07:50:53 +13:00
nu-json Bump to 0.25.2 (#2908) 2021-01-12 07:50:53 +13:00
nu-parser parser/add rest args to def (#2961) 2021-01-23 07:13:29 +13:00
nu-plugin Temporarily(?) switch from heim+uom to sysinfo (#2954) 2021-01-20 20:18:38 +13:00
nu-protocol Flush out! lines, helps autoview (#2952) 2021-01-20 07:23:37 +13:00
nu-source parser/add rest args to def (#2961) 2021-01-23 07:13:29 +13:00
nu-stream Bump to 0.25.2 (#2908) 2021-01-12 07:50:53 +13:00
nu-table a small regex optimization (#2937) 2021-01-15 20:20:28 +13:00
nu-test-support Bump to 0.25.2 (#2908) 2021-01-12 07:50:53 +13:00
nu-value-ext Bump to 0.25.2 (#2908) 2021-01-12 07:50:53 +13:00