36 lines
647 B
Plaintext
Raw Normal View History

2009-05-17 22:10:01 +02:00
# -*- mode: shell-script; sh-basic-offset: 8; indent-tabs-mode: t -*-
# ex: ts=8 sw=8 noet filetype=sh
#
# 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
2009-09-24 18:00:43 +02:00
COMPREPLY=( $( compgen -W '--help --version' -- $cur ) \
$( compgen -W 'bs cbs conv count ibs if obs of seek skip'\
2009-05-17 22:10:01 +02:00
-S '=' -- $cur ) )
} &&
complete -F _dd $nospace $filenames dd