]>
Commit | Line | Data |
---|---|---|
c6f8c3f5 SK |
1 | _tunelp_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 | '-i'|'--irq'|'-c'|'--chars') | |
9 | COMPREPLY=( $(compgen -W "number" -- $cur) ) | |
10 | return 0 | |
11 | ;; | |
12 | '-t'|'--time') | |
13 | COMPREPLY=( $(compgen -W "milliseconds" -- $cur) ) | |
14 | return 0 | |
15 | ;; | |
16 | '-w'|'--wait') | |
17 | COMPREPLY=( $(compgen -W "microseconds" -- $cur) ) | |
18 | return 0 | |
19 | ;; | |
37a6cc7a | 20 | '-a'|'--abort'|'-o'|'--check-status'|'-C'|'--careful'|'-q'|'--print-irq') |
c6f8c3f5 SK |
21 | COMPREPLY=( $(compgen -W "off on" -- $cur) ) |
22 | return 0 | |
23 | ;; | |
d4f9b8d7 VS |
24 | '-h'|'--help'|'-V'|'--version') |
25 | return 0 | |
26 | ;; | |
c6f8c3f5 SK |
27 | esac |
28 | case $cur in | |
29 | -*) | |
0d5b9b8a VS |
30 | OPTS="--irq |
31 | --time | |
32 | --chars | |
33 | --wait | |
34 | --abort | |
35 | --check-status | |
36 | --careful | |
37 | --status | |
0d5b9b8a VS |
38 | --reset |
39 | --print-irq | |
40 | --help | |
41 | --version" | |
c6f8c3f5 SK |
42 | COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) |
43 | return 0 | |
44 | ;; | |
45 | esac | |
ce3e6b15 | 46 | local IFS=$'\n' |
c6f8c3f5 SK |
47 | compopt -o filenames |
48 | COMPREPLY=( $(compgen -f -- ${cur:-"/dev/lp"}) ) | |
49 | return 0 | |
50 | } | |
51 | complete -F _tunelp_module tunelp |