]> git.ipfire.org Git - thirdparty/util-linux.git/blob - bash-completion/logger
bash-completion: update few options changed since v2.26
[thirdparty/util-linux.git] / bash-completion / logger
1 _logger_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'|'--journald')
9 local IFS=$'\n'
10 compopt -o filenames
11 COMPREPLY=( $(compgen -f -- $cur) )
12 return 0
13 ;;
14 '-n'|'--server')
15 COMPREPLY=( $(compgen -A hostname -- $cur) )
16 return 0
17 ;;
18 '-P'|'--port')
19 COMPREPLY=( $(compgen -W "$(awk '$1 ~ /^syslog$/ {split($2, a, "/"); print a[1]}' /etc/services)" -- $cur) )
20 return 0
21 ;;
22 '-p'|'--priority')
23 COMPREPLY=( $(compgen -W "{auth,authpriv,cron,daemon,ftp,lpr,mail,news,security}.{alert,crit,debug,emerg,err,error}" -- $cur) )
24 return 0
25 ;;
26 '-t'|'--tag')
27 COMPREPLY=( $(compgen -W "tag" -- $cur) )
28 return 0
29 ;;
30 '-u'|'--socket')
31 COMPREPLY=( $(compgen -W "$(awk '$NF ~ /^\// {print $NF}' /proc/net/unix)" -- $cur) )
32 return 0
33 ;;
34 '--msgid')
35 COMPREPLY=( $(compgen -W "msgid" -- $cur) )
36 return 0
37 ;;
38 '-h'|'--help'|'-V'|'--version')
39 return 0
40 ;;
41 esac
42 case $cur in
43 -*)
44 OPTS="
45 --file
46 --help
47 --id
48 --journald
49 --msgid
50 --no-act
51 --octet-count
52 --port
53 --prio-prefix
54 --priority
55 --rfc3164
56 --rfc5424
57 --server
58 --size
59 --skip-empty
60 --socket
61 --stderr
62 --tag
63 --udp
64 --version
65 "
66 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
67 return 0
68 ;;
69 esac
70 return 0
71 }
72 complete -F _logger_module logger