Skip to content

Commit

Permalink
added autocompletion script for pyobsd
Browse files Browse the repository at this point in the history
  • Loading branch information
thusser committed Dec 26, 2023
1 parent 7a4083d commit a1bdc74
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions autocompletion.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
function _pyobsd()
{
latest="${COMP_WORDS[$COMP_CWORD]}"
prev="${COMP_WORDS[$COMP_CWORD - 1]}"
words=""
case "${prev}" in
start|stop|restart)
words=`pyobsd list`
;;
*)
words="start stop restart status";;
esac
COMPREPLY=($(compgen -W "$words" -- $latest))
return 0
}

complete -F _pyobsd pyobsd

0 comments on commit a1bdc74

Please sign in to comment.