/
githubmirror
/
pm2
Обзор
Документация
Войти
/
githubmirror
/
pm2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
lib/completion.sh
40 строк
1 KB
Aymeric Lavit d'Hautefort
changed auto completion to tab completion for clarity
01 июл 2015, 15:56
01 июл 2015, 15:56
aae8260
Код
Авторство
О чём код?
###-begin-pm2-completion-### ### credits to npm for the completion file model # # Installation: pm2 completion >> ~/.bashrc (or ~/.zshrc) # COMP_WORDBREAKS=${COMP_WORDBREAKS/=/} COMP_WORDBREAKS=${COMP_WORDBREAKS/@/} export COMP_WORDBREAKS if type complete &>/dev/null; then _pm2_completion () { local si="$IFS" IFS=$'\n' COMPREPLY=($(COMP_CWORD="$COMP_CWORD" \ COMP_LINE="$COMP_LINE" \ COMP_POINT="$COMP_POINT" \ pm2 completion -- "${COMP_WORDS[@]}" \ 2>/dev/null)) || return $? IFS="$si" } complete -o default -F _pm2_completion pm2 elif type compctl &>/dev/null; then _pm2_completion () { local cword line point words si read -Ac words read -cn cword let cword-=1 read -l line read -ln point si="$IFS" IFS=$'\n' reply=($(COMP_CWORD="$cword" \ COMP_LINE="$line" \ COMP_POINT="$point" \ pm2 completion -- "${words[@]}" \ 2>/dev/null)) || return $? IFS="$si" } compctl -K _pm2_completion + -f + pm2 fi ###-end-pm2-completion-###