mirror of
https://git.sr.ht/~leon_plickat/wlopm
synced 2025-07-16 05:49:45 +02:00
add bash completion
This commit is contained in:
14
bash-completion
Normal file
14
bash-completion
Normal file
@ -0,0 +1,14 @@
|
||||
function __wlopm_completion ()
|
||||
{
|
||||
case "${COMP_WORDS[-2]}" in
|
||||
"--on"|"--off"|"--toggle")
|
||||
OPTS="$(wlopm | cut -d' ' -f1 | tr '\n' ' ')"
|
||||
;;
|
||||
|
||||
*)
|
||||
OPTS="-h --help -j --json -v --version --on --off --toggle"
|
||||
;;
|
||||
esac
|
||||
COMPREPLY=($(compgen -W "${OPTS}" -- "${COMP_WORDS[${COMP_CWORD}]}"))
|
||||
}
|
||||
complete -F __wlopm_completion wlopm
|
Reference in New Issue
Block a user