mas/contrib/completion/mas-completion.bash
Chris Araman 64695e2457
📜 Lint
2021-03-28 14:12:02 -07:00

17 lines
368 B
Bash

#!/usr/bin/env bash
_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 +3 | awk '{print $1}')" -- "$cur"))
return 0
fi
}
complete -F _mas mas