Debian Codegraph @

bash-completion/setarch

raw
1 _setarch_module()
2 {
3 local cur prev OPTS
4 COMPREPLY=()
5 cur="${COMP_WORDS[COMP_CWORD]}"
6 prev="${COMP_WORDS[COMP_CWORD-1]}"
7 pprev="${COMP_WORDS[COMP_CWORD-2]}"
8 case $pprev in
9 '-p'|'--pid')
10 COMPREPLY=( $(compgen -W "--show" -- $cur) )
11 return 0
12 ;;
13 esac
14 case $prev in
15 '-h'|'--help'|'-V'|'--version')
16 return 0
17 ;;
18 '-p'|'--pid')
19 COMPREPLY=( $(compgen -W "$(builtin cd /proc && echo [0-9]*)" -- $cur) )
20 return 0
21 ;;
22 '--show')
23 OPTS="
24 current
25 --pid
26 "
27 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
28 return 0
29 ;;
30 esac
31 if [ $COMP_CWORD -eq 1 ]; then
32 OPTS="$($1 --list)"
33 OPTS="$OPTS
34 --list
35 --help
36 --version
37 --show
38 "
39 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
40 return 0
41 fi
42 case $cur in
43 -*)
44 OPTS="
45 --32bit
46 --fdpic-funcptrs
47 --short-inode
48 --addr-compat-layout
49 --addr-no-randomize
50 --whole-seconds
51 --sticky-timeouts
52 --read-implies-exec
53 --mmap-page-zero
54 --3gb
55 --4gb
56 --uname-2.6
57 --verbose
58 --list
59 --help
60 --version
61 "
62 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
63 return 0
64 ;;
65 esac
66 compopt -o bashdefault
67 COMPREPLY=( $(compgen -c -- $cur) )
68 return 0
69 }
70 complete -F _setarch_module setarch