2009-05-17 22:10:01 +02:00
|
|
|
# bash completion for dd
|
|
|
|
|
|
|
|
have dd &&
|
|
|
|
_dd()
|
|
|
|
{
|
2009-10-04 19:42:50 +02:00
|
|
|
local cur
|
2009-05-17 22:10:01 +02:00
|
|
|
|
2009-10-04 19:42:50 +02:00
|
|
|
COMPREPLY=()
|
2010-02-08 17:25:08 +01:00
|
|
|
_get_comp_words_by_ref -n = cur
|
2009-05-17 22:10:01 +02:00
|
|
|
|
2009-12-30 00:39:59 +01:00
|
|
|
case $cur in
|
2010-10-24 12:37:22 +03:00
|
|
|
if=*|of=*)
|
|
|
|
cur=${cur#*=}
|
|
|
|
_filedir
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
conv=*)
|
|
|
|
cur=${cur#*=}
|
|
|
|
COMPREPLY=( $( compgen -W 'ascii ebcdic ibm block unblock lcase
|
|
|
|
notrunc ucase swab noerror sync' -- "$cur" ) )
|
|
|
|
return 0
|
|
|
|
;;
|
2009-10-04 19:42:50 +02:00
|
|
|
esac
|
2009-05-17 22:10:01 +02:00
|
|
|
|
2009-10-04 19:42:50 +02:00
|
|
|
_expand || return 0
|
2009-05-17 22:10:01 +02:00
|
|
|
|
2009-10-04 19:42:50 +02:00
|
|
|
COMPREPLY=( $( compgen -W '--help --version' -- "$cur" ) \
|
2010-10-24 12:37:22 +03:00
|
|
|
$( compgen -W 'bs cbs conv count ibs if obs of seek skip' \
|
|
|
|
-S '=' -- "$cur" ) )
|
2009-05-17 22:10:01 +02:00
|
|
|
} &&
|
2009-10-22 12:04:29 +03:00
|
|
|
complete -F _dd -o nospace -o filenames dd
|
2009-10-01 20:54:51 +03:00
|
|
|
|
|
|
|
# Local variables:
|
|
|
|
# mode: shell-script
|
2009-10-04 19:42:50 +02:00
|
|
|
# sh-basic-offset: 4
|
2009-10-01 20:54:51 +03:00
|
|
|
# sh-indent-comment: t
|
2009-10-04 19:42:50 +02:00
|
|
|
# indent-tabs-mode: nil
|
2009-10-01 20:54:51 +03:00
|
|
|
# End:
|
2009-10-04 19:42:50 +02:00
|
|
|
# ex: ts=4 sw=4 et filetype=sh
|