Add basic growisofs completion.
This commit is contained in:
parent
dfb84064a4
commit
642ef5344f
2
CHANGES
2
CHANGES
@ -9,7 +9,7 @@ bash-completion (2.x)
|
|||||||
[ Ville Skyttä ]
|
[ Ville Skyttä ]
|
||||||
* Activate hping2 completion also for hping and hping3.
|
* Activate hping2 completion also for hping and hping3.
|
||||||
* Add badblocks, compgen, crontab, dumpe2fs, e2freefrag, e2label, ether-wake,
|
* 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.
|
sha{,224,256,384,512}sum, sysbench, tune2fs, xmodmap, and xrdb completions.
|
||||||
* Add *.gif (Alioth: #312512), *.m2t (Alioth: #312770), *.3gpp, *.3gpp2,
|
* Add *.gif (Alioth: #312512), *.m2t (Alioth: #312770), *.3gpp, *.3gpp2,
|
||||||
*.awb, and *.iso (Alioth: #311420) to mplayer filename completions.
|
*.awb, and *.iso (Alioth: #311420) to mplayer filename completions.
|
||||||
|
@ -35,6 +35,7 @@ bashcomp_DATA = abook \
|
|||||||
dpkg \
|
dpkg \
|
||||||
dselect \
|
dselect \
|
||||||
dsniff \
|
dsniff \
|
||||||
|
dvd+rw-tools \
|
||||||
e2fsprogs \
|
e2fsprogs \
|
||||||
findutils \
|
findutils \
|
||||||
freeciv \
|
freeciv \
|
||||||
|
47
completions/dvd+rw-tools
Normal file
47
completions/dvd+rw-tools
Normal 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
|
1
test/completion/growisofs.exp
Normal file
1
test/completion/growisofs.exp
Normal file
@ -0,0 +1 @@
|
|||||||
|
assert_source_completions growisofs
|
20
test/lib/completions/growisofs.exp
Normal file
20
test/lib/completions/growisofs.exp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
proc setup {} {
|
||||||
|
save_env
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
proc teardown {} {
|
||||||
|
assert_env_unmodified
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
setup
|
||||||
|
|
||||||
|
|
||||||
|
assert_complete_any "growisofs "
|
||||||
|
|
||||||
|
|
||||||
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
|
teardown
|
Loading…
x
Reference in New Issue
Block a user