wlopm/bash-completion

15 lines
352 B
Plaintext
Raw Permalink Normal View History

2024-03-28 19:11:46 +01:00
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