File: bash-completion

package info (click to toggle)
wlopm 1.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 152 kB
  • sloc: ansic: 486; xml: 110; makefile: 67
file content (14 lines) | stat: -rw-r--r-- 352 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
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