export extern-wrapped for core

Define an extern with a custom code block and export it from a module.

Signature

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

Parameters

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

Input/output types:

inputoutput
nothingnothing

Examples

Export the signature for an external command

> export extern-wrapped my-echo [...rest] { echo $rest }

Notes

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