dotfiles/home/.bash_completion.d/oath

10 lines
203 B
Text

function _oath_completion() {
if [ -n "$2" ]; then
WORD=$2
mapfile -t COMPREPLY < <(grep -i $2 ~/.oath_tokens)
else
mapfile -t COMPREPLY < ~/.oath_tokens
fi
}
complete -F _oath_completion oath