formatted apm completion and used helper function
parent
2c39053879
commit
f71d76990a
|
|
@ -24,7 +24,9 @@
|
|||
|
||||
# repo: https://github.com/vigo/apm-bash-completion
|
||||
|
||||
__apm(){
|
||||
if _command_exists apm
|
||||
then
|
||||
function __apm(){
|
||||
local cur prev options apm_command
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
|
|
@ -50,8 +52,9 @@ __apm(){
|
|||
fi
|
||||
fi
|
||||
COMPREPLY=($(compgen -W "$options" -- "$cur"))
|
||||
}
|
||||
__apm_get_command() {
|
||||
}
|
||||
|
||||
function __apm_get_command() {
|
||||
local i
|
||||
for ((i=1; i < $COMP_CWORD; ++i)); do
|
||||
local arg=${COMP_WORDS[$i]}
|
||||
|
|
@ -73,5 +76,7 @@ __apm_get_command() {
|
|||
return;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
complete -F __apm -o bashdefault -o default apm
|
||||
}
|
||||
|
||||
complete -F __apm -o bashdefault -o default apm
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in New Issue