mas/contrib/completion/mas-completion.bash

18 lines
377 B
Bash
Raw Normal View History

2018-07-06 20:19:25 -07:00
#!/usr/bin/env bash
2021-03-21 16:50:09 -07:00
_mas() {
local cur prev words cword
if declare -F _init_completions >/dev/null 2>&1; then
_init_completion
else
COMPREPLY=()
_get_comp_words_by_ref cur prev words cword
fi
if [[ "${cword}" -eq 1 ]]; then
COMPREPLY=($(compgen -W "$(mas help | tail -n +3 | awk '{print $1}')" -- "${cur}"))
2021-03-21 16:50:09 -07:00
return 0
fi
2018-07-06 20:19:25 -07:00
}
complete -F _mas mas