added bash completions

pull/1385/head
Gurkirat Singh 2019-06-08 02:50:24 +05:30
parent f055fc0cd7
commit 2cbe78b11a
1 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,15 @@
#!/usr/bin/bash
if command -v hosts > /dev/null; then
__hosts_completions() {
local OPTS=("add list remove")
COMPREPLY=()
for _opt_ in ${OPTS[@]}; do
if [[ "$_opt_" == "$2"* ]]; then
COMPREPLY+=("$_opt_")
fi
done
}
complete -F __hosts_completions
fi