eject: New completion.
This commit is contained in:
parent
904faab0c5
commit
b9276c8a37
@ -75,6 +75,7 @@ bashcomp_DATA = a2x \
|
||||
dumpe2fs \
|
||||
e2freefrag \
|
||||
e2label \
|
||||
eject \
|
||||
eog \
|
||||
ether-wake \
|
||||
evince \
|
||||
|
30
completions/eject
Normal file
30
completions/eject
Normal file
@ -0,0 +1,30 @@
|
||||
# bash completion for eject(1) -*- shell-script -*-
|
||||
|
||||
_eject()
|
||||
{
|
||||
local cur prev words cword
|
||||
_init_completion || return
|
||||
|
||||
case $prev in
|
||||
-h|--help|-V|--version|-c|--changerslot|-x|--cdspeed)
|
||||
return
|
||||
;;
|
||||
-a|--auto|-i|--manualeject)
|
||||
COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) )
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ $cur == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
|
||||
return
|
||||
elif [[ $prev == @(-d|--default) ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
_cd_devices
|
||||
_dvd_devices
|
||||
} &&
|
||||
complete -F _eject eject
|
||||
|
||||
# ex: ts=4 sw=4 et filetype=sh
|
1
test/completion/eject.exp
Normal file
1
test/completion/eject.exp
Normal file
@ -0,0 +1 @@
|
||||
assert_source_completions eject
|
18
test/lib/completions/eject.exp
Normal file
18
test/lib/completions/eject.exp
Normal file
@ -0,0 +1,18 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "eject -"
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
Loading…
x
Reference in New Issue
Block a user