dmesg: New completion.

master
Ville Skyttä 2011-10-11 21:10:45 +03:00
parent 049b60ec61
commit a6c9c614d4
3 changed files with 44 additions and 0 deletions

View File

@ -116,6 +116,31 @@ _ionice()
} &&
complete -F _ionice ionice
have dmesg &&
_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

View File

@ -0,0 +1 @@
assert_source_completions dmesg

View File

@ -0,0 +1,18 @@
proc setup {} {
save_env
}
proc teardown {} {
assert_env_unmodified
}
setup
assert_complete_any "dmesg -"
sync_after_int
teardown