2019-03-09 15:11:43 +00:00
|
|
|
complete -c dmesg -f -d 'Display system message buffer'
|
2012-07-16 02:03:01 +00:00
|
|
|
|
2019-03-09 15:11:43 +00:00
|
|
|
switch (uname -s)
|
2019-05-05 10:53:09 +00:00
|
|
|
#
|
|
|
|
# Solaris
|
|
|
|
#
|
|
|
|
case SunOS
|
|
|
|
exit 1 # no options, we are done
|
|
|
|
#
|
|
|
|
# Loonix dmesg
|
|
|
|
#
|
|
|
|
case Linux
|
2023-08-16 19:56:08 +00:00
|
|
|
set -l levels '( __fish_append , emerg alert crit err warn notice info debug)'
|
2019-05-05 10:53:09 +00:00
|
|
|
complete -c dmesg -s C -l clear -f -d'Clear kernel ring buffer'
|
|
|
|
complete -c dmesg -s c -l read-clear -f -d'Read & clear all msgs'
|
|
|
|
complete -c dmesg -s D -l console-off -f -d'Disable writing to console'
|
|
|
|
complete -c dmesg -s d -l show-delta -f -d'Show timestamp deltas'
|
|
|
|
complete -c dmesg -s E -l console-on -f -d'Enable writing to console'
|
|
|
|
complete -c dmesg -s F -l file -r -d'Use file instead of log buffer'
|
2023-08-16 19:56:08 +00:00
|
|
|
complete -c dmesg -s f -l facility -x -d'Only print for given facilities' -a '( __fish_append , kern user mail daemon auth syslog lpr news)'
|
2019-05-05 10:53:09 +00:00
|
|
|
complete -c dmesg -s h -l help -f -d'Display help'
|
|
|
|
complete -c dmesg -s k -l kernel -f -d'Print kernel messages'
|
|
|
|
complete -c dmesg -s l -l level -x -d'Restrict output to given levels' -a $levels
|
|
|
|
complete -c dmesg -s n -l console-level -x -d'Adjust threshold to print to console' -a $levels
|
|
|
|
complete -c dmesg -s r -l raw -f -d'Print raw message buffer'
|
|
|
|
complete -c dmesg -s s -l buffer-size -x -d'Buffer size to query kernel'
|
|
|
|
complete -c dmesg -s T -l ctime -f -d'Human-readable timestamps'
|
|
|
|
complete -c dmesg -s t -l notime -f -d'Don\'t print timestamps'
|
|
|
|
complete -c dmesg -s u -l userspace -f -d'Print userspace messages'
|
|
|
|
complete -c dmesg -s V -l version -f -d'Show dmesg version'
|
2021-10-19 00:34:13 +00:00
|
|
|
complete -c dmesg -s w -l follow -f -d'Wait for new messages'
|
|
|
|
complete -c dmesg -s W -l follow-new -f -d'Wait and print only new messages'
|
2019-05-05 10:53:09 +00:00
|
|
|
complete -c dmesg -s x -l decode -f -d'Decode facility & level numbers'
|
|
|
|
exit 0 # done
|
|
|
|
#
|
|
|
|
# unique options specific BSDs have
|
|
|
|
#
|
|
|
|
case NetBSD
|
|
|
|
complete -c dmesg -s d -f -d'show timestamp deltas'
|
|
|
|
complete -c dmesg -s T -f -d'human-readable timestamps'
|
|
|
|
complete -c dmesg -s t -f -d'don\'t print timestamps'
|
|
|
|
case OpenBSD
|
|
|
|
complete -c dmesg -s S -f -d'display console message buffer-size'
|
|
|
|
case FreeBSD DragonFly
|
|
|
|
complete -c dmesg -s a -f -d'print all data in the message buffer'
|
|
|
|
complete -c dmesg -s c -f -d'clear kernel buffer after printing'
|
2019-03-09 15:11:43 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# common BSD dmesg options (macOS only does these two)
|
|
|
|
#
|
2019-05-05 10:53:09 +00:00
|
|
|
complete -c dmesg -s M -r -d'get namelist values from given core'
|
|
|
|
complete -c dmesg -s N -r -d'get namelist from given kernel'
|