]> git.ipfire.org Git - thirdparty/util-linux.git/blame - bash-completion/getopt
su: use lib/pty-session.c code for --pty
[thirdparty/util-linux.git] / bash-completion / getopt
CommitLineData
76dceb10
SK
1_getopt_module()
2{
3 local cur prev OPTS
4 COMPREPLY=()
5 cur="${COMP_WORDS[COMP_CWORD]}"
6 prev="${COMP_WORDS[COMP_CWORD-1]}"
7 case $prev in
8 '-l'|'--longoptions')
9 COMPREPLY=( $(compgen -W "longopts" -- $cur) )
10 return 0
11 ;;
12 '-n'|'--name')
13 COMPREPLY=( $(compgen -W "name" -- $cur) )
14 return 0
15 ;;
16 '-o'|'--options')
17 COMPREPLY=( $(compgen -W "optstring" -- $cur) )
18 return 0
19 ;;
20 '-s'|'--shell')
21 COMPREPLY=( $(compgen -W "sh bash csh tcsh" -- $cur) )
22 return 0
23 ;;
d4f9b8d7
VS
24 '-h'|'--help'|'-V'|'--version')
25 return 0
26 ;;
76dceb10
SK
27 esac
28 case $cur in
29 -*)
0d5b9b8a 30 OPTS="--alternative --help --longoptions --name --options --quiet --quiet-output --shell --test --unquoted --version"
76dceb10
SK
31 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
32 return 0
33 ;;
34 esac
35 return 0
36}
37complete -F _getopt_module getopt