]> git.ipfire.org Git - thirdparty/util-linux.git/blob - bash-completion/last
su: use lib/pty-session.c code for --pty
[thirdparty/util-linux.git] / bash-completion / last
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
8 '-f'|'--file')
9 local IFS=$'\n'
10 compopt -o filenames
11 COMPREPLY=( $(compgen -f -- $cur) )
12 return 0
13 ;;
14 '-n'|'--limit')
15 COMPREPLY=( $(compgen -W "number" -- $cur) )
16 return 0
17 ;;
18 '-s'|'--since'|'-t'|'--until'|'-p'|'--present')
19 COMPREPLY=( $(compgen -W "number" -- $cur) )
20 return 0
21 ;;
22 '--time-format')
23 COMPREPLY=( $(compgen -W "notime short full iso" -- $cur) )
24 return 0
25 ;;
26 esac
27 case $cur in
28 -*)
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 "
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