Add Lerna completion options

pull/1248/head
William A. O. Brown 2018-10-25 21:37:35 +01:00
parent 4a64dcbc6f
commit 9040359f6c
1 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,25 @@
#!/bin/bash
# Usage:
#
# To enable bash <tab> completion for lerna, add the following line (minus the
# leading #, which is the bash comment character) to your ~/.bashrc file:
#
# eval "$(lerna --completion=bash)"
# Enable bash autocompletion.
function _lerna_completions() {
# The currently-being-completed word.
local cur compls
cur="${COMP_WORDS[COMP_CWORD]}"
# Options
compls="add bootstrap changed clean create diff exec \
import init link list publish run version \
--loglevel --concurrency --reject-cycles \
--progress --sort --no-sort --help \
--version"
# Tell complete what stuff to show.
COMPREPLY=($(compgen -W "$compls" -- "$cur"))
}
complete -o default -F _lerna_completions lerna