41 lines
697 B
Plaintext
Raw Normal View History

2009-05-17 22:10:01 +02:00
# bash completion for dd
have dd &&
_dd()
{
2009-09-24 18:00:43 +02:00
local cur
2009-05-17 22:10:01 +02:00
2009-09-24 18:00:43 +02:00
COMPREPLY=()
cur=`_get_cword =`
2009-05-17 22:10:01 +02:00
2009-09-24 18:00:43 +02:00
case "$cur" in
if=*|of=*)
cur=${cur#*=}
_filedir
return 0
;;
conv=*)
cur=${cur#*=}
COMPREPLY=( $( compgen -W 'ascii ebcdic ibm block unblock \
2009-05-17 22:10:01 +02:00
lcase notrunc ucase swab noerror sync' \
-- "$cur" ) )
2009-09-24 18:00:43 +02:00
return 0
;;
esac
2009-05-17 22:10:01 +02:00
2009-09-24 18:00:43 +02:00
_expand || return 0
2009-05-17 22:10:01 +02:00
COMPREPLY=( $( compgen -W '--help --version' -- "$cur" ) \
2009-09-24 18:00:43 +02:00
$( compgen -W 'bs cbs conv count ibs if obs of seek skip'\
-S '=' -- "$cur" ) )
2009-05-17 22:10:01 +02:00
} &&
complete -F _dd $nospace $filenames dd
# Local variables:
# mode: shell-script
# sh-basic-offset: 8
# sh-indent-comment: t
# indent-tabs-mode: t
# End:
# ex: ts=8 sw=8 noet filetype=sh