dmesg: New completion.
parent
049b60ec61
commit
a6c9c614d4
|
@ -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
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
assert_source_completions dmesg
|
|
@ -0,0 +1,18 @@
|
|||
proc setup {} {
|
||||
save_env
|
||||
}
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "dmesg -"
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
Loading…
Reference in New Issue