]>
Commit | Line | Data |
---|---|---|
41e5a92c SK |
1 | _last_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 | |
f4e8fd91 | 8 | '-f'|'--file') |
ce3e6b15 | 9 | local IFS=$'\n' |
41e5a92c SK |
10 | compopt -o filenames |
11 | COMPREPLY=( $(compgen -f -- $cur) ) | |
12 | return 0 | |
13 | ;; | |
f4e8fd91 SK |
14 | '-n'|'--limit') |
15 | COMPREPLY=( $(compgen -W "number" -- $cur) ) | |
41e5a92c SK |
16 | return 0 |
17 | ;; | |
f4e8fd91 SK |
18 | '-s'|'--since'|'-t'|'--until'|'-p'|'--present') |
19 | COMPREPLY=( $(compgen -W "number" -- $cur) ) | |
41e5a92c SK |
20 | return 0 |
21 | ;; | |
f4e8fd91 SK |
22 | '--time-format') |
23 | COMPREPLY=( $(compgen -W "notime short full iso" -- $cur) ) | |
41e5a92c SK |
24 | return 0 |
25 | ;; | |
26 | esac | |
27 | case $cur in | |
28 | -*) | |
f4e8fd91 SK |
29 | OPTS=" |
30 | --hostlast | |
31 | --dns | |
32 | --file | |
33 | --fulltimes | |
34 | --ip | |
35 | --limit | |
36 | --nohostname | |
37 | --since | |
38 | --until | |
39 | --present | |
40 | --fullnames | |
41 | --system | |
42 | --time-format | |
43 | --help | |
44 | --version | |
45 | " | |
41e5a92c SK |
46 | COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) |
47 | return 0 | |
48 | ;; | |
49 | esac | |
50 | COMPREPLY=( $(compgen -u -- $cur) ) | |
51 | return 0 | |
52 | } | |
53 | complete -F _last_module last |