extern-wrapped for core

Define a signature for an external command with a custom code block.

Signature

> extern-wrapped (def_name) (params) (body)

Parameters

  • def_name: definition name
  • params: parameters
  • body: wrapper code block

Input/output types:

inputoutput
nothingnothing

Examples

Define a custom wrapper for an external command

> extern-wrapped my-echo [...rest] { echo $rest }; my-echo spam
╭───┬──────╮
│ 0 │ spam │
╰───┴──────╯

Notes

This command is a parser keyword. For details, check: https://www.nushell.sh/book/thinking_in_nu.html