dmesg: New completion.
This commit is contained in:
parent
049b60ec61
commit
a6c9c614d4
@ -116,6 +116,31 @@ _ionice()
|
|||||||
} &&
|
} &&
|
||||||
complete -F _ionice 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:
|
# Local variables:
|
||||||
# mode: shell-script
|
# mode: shell-script
|
||||||
# sh-basic-offset: 4
|
# sh-basic-offset: 4
|
||||||
|
1
test/completion/dmesg.exp
Normal file
1
test/completion/dmesg.exp
Normal file
@ -0,0 +1 @@
|
|||||||
|
assert_source_completions dmesg
|
18
test/lib/completions/dmesg.exp
Normal file
18
test/lib/completions/dmesg.exp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
proc setup {} {
|
||||||
|
save_env
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
proc teardown {} {
|
||||||
|
assert_env_unmodified
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
setup
|
||||||
|
|
||||||
|
|
||||||
|
assert_complete_any "dmesg -"
|
||||||
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
|
teardown
|
Loading…
x
Reference in New Issue
Block a user