Externs
This is where comes in. The extern
keyword allows you to write a full signature for the command that lives outside of Nushell so that you get all the benefits above. If you take a look at the default config, you’ll notice that there are a few extern calls in there. Here’s one of them:
In the above example, you’ll notice some types are followed by followed by the name of a command. We talk more about custom completions in their own section.
Limitations
There are a few limitations to the current extern
syntax. In Nushell, flags and positional arguments are very flexible: flags can precede positional arguments, flags can be mixed into positional arguments, and flags can follow positional arguments. Many external commands are not this flexible. There is not yet a way to require a particular ordering of flags and positional arguments to the style required by the external.