Skip to content

Instantly share code, notes, and snippets.

@thegedge
Last active July 25, 2020 15:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thegedge/6c46a740e1e7fadfaa29fe061fc5ea48 to your computer and use it in GitHub Desktop.
Save thegedge/6c46a740e1e7fadfaa29fe061fc5ea48 to your computer and use it in GitHub Desktop.
nushell completion locations

Completion locations

Command head

Completion types:

  • Internal commands and subcommands
  • External commands
  • Files (executable)

Location(s):

  • Beginning of a pipeline
  • command <subcommand>

Positional argument

Completion types:

  • Based on signature

Location(s):

  • command <arg>
  • ... | command <arg> ... | ...

Named argument

Completion types:

  • Flag names (from signature)

Location(s):

  • command -<short> ...
  • command --<long> ...

Named argument value

Completion types:

  • Based on signature

Location(s):

  • command -f <arg>
  • command --flag=<arg>

Variable

Completion types:

  • Variable names from context
  • Argument names from alias

Location(s):

  • $<var>
  • $a.b.<var>

Math expression

Completion types:

  • Operators

Location(s):

  • = value <op> value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment