formatted lerna completion and used helper function
parent
244c6a62b5
commit
3ed0063fa6
|
|
@ -1,19 +1,23 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Lerna autocompletion.
|
# Lerna autocompletion.
|
||||||
function _lerna_completions() {
|
|
||||||
local cur compls
|
|
||||||
|
|
||||||
# The currently-being-completed word.
|
if _command_exists lerna
|
||||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
then
|
||||||
|
function _lerna_completions() {
|
||||||
|
local cur compls
|
||||||
|
|
||||||
# Options
|
# The currently-being-completed word.
|
||||||
compls="add bootstrap changed clean create diff exec \
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
import init link list publish run version \
|
|
||||||
--loglevel --concurrency --reject-cycles \
|
|
||||||
--progress --sort --no-sort --help \
|
|
||||||
--version"
|
|
||||||
|
|
||||||
# Tell complete what stuff to show.
|
# Options
|
||||||
COMPREPLY=($(compgen -W "$compls" -- "$cur"))
|
compls="add bootstrap changed clean create diff exec \
|
||||||
}
|
import init link list publish run version \
|
||||||
complete -o default -F _lerna_completions lerna
|
--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
|
||||||
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue