From a1bdc74016304cbbd58d2b13028c47a6218e6b35 Mon Sep 17 00:00:00 2001 From: Tim-Oliver Husser Date: Tue, 26 Dec 2023 17:00:50 +0100 Subject: [PATCH] added autocompletion script for pyobsd --- autocompletion.bash | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 autocompletion.bash diff --git a/autocompletion.bash b/autocompletion.bash new file mode 100644 index 00000000..a436a571 --- /dev/null +++ b/autocompletion.bash @@ -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