nushell/crates/nu-cmd-lang/src
Jelle Besseling 44493dac51
Add extern def which allows raw arguments (#8956)
# Description

Extends the `extern` syntax to allow commands that accept raw arguments.
This is mainly added to allow wrapper type scripts for external
commands.

This is an example on how this can be used:

```nushell
extern foo [...rest] { 
  print ($rest | str join ',' ) 
}
foo --bar baz -- -q -u -x
# => --bar,baz,--,-q,-u,-x
```

(It's only possible to accept a single ...varargs argument in the
signature)

# User-Facing Changes

No breaking changes, just extra possibilities.

# Tests + Formatting

Added a test for this new behaviour and ran the toolkit pr checker

# After Submitting

This is advanced functionality but it should be documented, I will open
a new PR on the book for that

Co-authored-by: Jelle Besseling <jelle@bigbridge.nl>
2023-04-28 09:06:43 +02:00
..
core_commands Add extern def which allows raw arguments (#8956) 2023-04-28 09:06:43 +02:00
default_context.rs Move CLI related commands to nu-cli (#8832) 2023-04-10 10:56:47 +12:00
example_support.rs Remove old alias implementation (#8797) 2023-04-07 21:09:38 +03:00
example_test.rs Fix closures that use matches. Move 'collect' to core. (#8596) 2023-03-24 22:50:23 +13:00
lib.rs cratification: Example support (#8231) 2023-02-27 13:58:56 -08:00