Add basic growisofs completion.

This commit is contained in:
Ville Skyttä 2010-11-03 21:11:07 +02:00
parent dfb84064a4
commit 642ef5344f
5 changed files with 70 additions and 1 deletions

View File

@ -9,7 +9,7 @@ bash-completion (2.x)
[ Ville Skyttä ]
* Activate hping2 completion also for hping and hping3.
* Add badblocks, compgen, crontab, dumpe2fs, e2freefrag, e2label, ether-wake,
filefrag, iftop, ip (Debian: #600617), lrzip, POSIX sh,
filefrag, growisofs, iftop, ip (Debian: #600617), lrzip, POSIX sh,
sha{,224,256,384,512}sum, sysbench, tune2fs, xmodmap, and xrdb completions.
* Add *.gif (Alioth: #312512), *.m2t (Alioth: #312770), *.3gpp, *.3gpp2,
*.awb, and *.iso (Alioth: #311420) to mplayer filename completions.

View File

@ -35,6 +35,7 @@ bashcomp_DATA = abook \
dpkg \
dselect \
dsniff \
dvd+rw-tools \
e2fsprogs \
findutils \
freeciv \

47
completions/dvd+rw-tools Normal file
View File

@ -0,0 +1,47 @@
# dvd+rw-tools completions
have growisofs &&
_growisofs()
{
COMPREPLY=()
local cur prev
_get_comp_words_by_ref cur prev
case $prev in
-version|-speed)
return 0
;;
-Z|-M)
compopt -o nospace &>/dev/null
_dvd_devices
return 0
;;
/?(r)dev/*)
if [[ $cur == =* ]] ; then
# e.g. /dev/dvd=foo.iso, /dev/dvdrw=/dev/zero
cur="${cur#=}"
_filedir
return 0
fi
;;
esac
if [[ "$cur" == -* ]]; then
# TODO: mkisofs options
COMPREPLY=( $( compgen -W '-dvd-compat -overburn -speed= -Z -M' \
-- "$cur" ) )
[[ ${COMPREPLY[@]} == *= ]] && compopt -o nospace &>/dev/null
return 0
fi
_filedir
} &&
complete -F _growisofs growisofs
# 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

View File

@ -0,0 +1 @@
assert_source_completions growisofs

View File

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