The completion command generates a shell completion script for neon. Once installed, the script presents the possible commands and options when you press the tab key after typing or partially typing a command or option.

Usage

neon completion

important

Generate the completion script in your own terminal, as the script may differ depending on your operating environment.

Show output
Output
###-begin-neon-completions-###
#
# yargs command completion script
#
# Installation: neon completion >> ~/.bashrc
#    or neon completion >> ~/.bash_profile on OSX.
#
_neon_yargs_completions()
{
    local cur_word args type_list

    cur_word="${COMP_WORDS[COMP_CWORD]}"
    args=("${COMP_WORDS[@]}")

    # ask yargs to generate completions.
    type_list=$(neon --get-yargs-completions "${args[@]}")

    COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) )

    # if no match was found, fall back to filename completion
    if [ ${#COMPREPLY[@]} -eq 0 ]; then
      COMPREPLY=()
    fi

    return 0
}
complete -o bashdefault -o default -F _neon_yargs_completions neon
###-end-neon-completions-###

Examples

Add the completion script to your shell configuration file in your home directory. The file differs by platform: Ubuntu typically uses .bashrc, while macOS uses .bash_profile or .zshrc. The source command applies the change to the current shell session.

Add the completion script to .bashrc:

neon completion >> ~/.bashrc
source ~/.bashrc

Add the completion script to .bash_profile:

neon completion >> ~/.bash_profile
source ~/.bash_profile

Add the completion script to .profile:

neon completion >> ~/.profile
source ~/.profile

Add the completion script to .zshrc:

neon completion >> ~/.zshrc
source ~/.zshrc