Add k3b completion.

This commit is contained in:
Ville Skyttä 2009-11-03 22:24:41 +02:00
parent a58062400d
commit 93060b4133
5 changed files with 76 additions and 1 deletions

View File

@ -22,7 +22,7 @@ bash-completion (2.x)
* Improve configure, cvs, gkrellm, lftp, mdadm, mysqladmin, and ssh * Improve configure, cvs, gkrellm, lftp, mdadm, mysqladmin, and ssh
completions. completions.
* Add abook and wtf completion, based on work by Raphaël Droz. * Add abook and wtf completion, based on work by Raphaël Droz.
* Add lftpget completion. * Add k3b and lftpget completion.
* Don't overwrite other host completions when completing from multiple * Don't overwrite other host completions when completing from multiple
SSH known hosts files. SSH known hosts files.
* Speed up installed rpm package completion on SUSE, based on work by * Speed up installed rpm package completion on SUSE, based on work by

View File

@ -57,6 +57,7 @@ bashcomp_DATA = contrib/abook \
contrib/isql \ contrib/isql \
contrib/jar \ contrib/jar \
contrib/java \ contrib/java \
contrib/k3b \
contrib/kldload \ contrib/kldload \
contrib/larch \ contrib/larch \
contrib/ldapvi \ contrib/ldapvi \

53
contrib/k3b Normal file
View File

@ -0,0 +1,53 @@
# bash completion for k3b
have k3b &&
_k3b()
{
local cur=`_get_cword` prev=${COMP_WORDS[COMP_CWORD-1]}
COMPREPLY=()
case "$prev" in
--help*|--author|-v|--version|--license|--lang)
return 0
;;
--datacd|--audiocd|--videocd|--mixedcd|--emovixcd|--videodvd)
_filedir
return 0
;;
--copydvd|--formatdvd|--videodvdrip)
cur=${cur:=/dev/}
COMPREPLY=( $( compgen -f -d -X "!*/?(r)dvd*" -- "$cur" ) )
return 0
;;
--copycd|--erasecd|--cddarip|--videocdrip)
cur=${cur:=/dev/}
COMPREPLY=( $( compgen -f -d -X "!*/@(?([amrs])cd|?(r)dvd)*" \
-- "$cur" ) )
return 0
;;
--cdimage|--image)
_filedir @(cue|iso|toc)
return 0
;;
--dvdimage)
_filedir iso
return 0
;;
--ao)
COMPREPLY=( $( compgen -W 'alsa arts' -- "$cur" ) )
return 0
;;
esac
_filedir
_longopt k3b
} &&
complete -F _k3b -o filenames k3b
# 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

1
test/completion/k3b.exp Normal file
View File

@ -0,0 +1 @@
source "lib/completions/k3b.exp"

View File

@ -0,0 +1,20 @@
proc setup {} {
save_env
}; # setup()
proc teardown {} {
assert_env_unmodified
}; # teardown()
setup
assert_complete_any "k3b "
sync_after_int
teardown