summaryrefslogtreecommitdiff
path: root/completions/dmesg
diff options
context:
space:
mode:
Diffstat (limited to 'completions/dmesg')
-rw-r--r--completions/dmesg33
1 files changed, 33 insertions, 0 deletions
diff --git a/completions/dmesg b/completions/dmesg
new file mode 100644
index 00000000..7aad7be5
--- /dev/null
+++ b/completions/dmesg
@@ -0,0 +1,33 @@
+# dmesg(1) completion
+
+_dmesg()
+{
+ [[ $OSTYPE == *solaris* ]] && return # no args there
+
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -s|-M|-N)
+ return
+ ;;
+ -n)
+ COMPREPLY=( $( compgen -W '{1..8}' -- "$cur" ) )
+ return
+ ;;
+ esac
+
+ if [[ $cur == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
+ return
+ fi
+} &&
+complete -F _dmesg dmesg
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh