haiku/data/etc/bash_completion.d/e2fsprogs
Brecht Machiels 4a135b33b7 * upgraded bash_completion to v1.3
* upgraded to subversion bash completion script shipped with subversion 1.6.17
* added git bash completion script shipped with git 1.7.5.4
* readded bash completion to the image

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42257 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-06-19 21:19:36 +00:00

181 lines
3.6 KiB
Bash

# bash completion for e2fsprogs
have badblocks &&
_badblocks()
{
COMPREPLY=()
local cur prev
_get_comp_words_by_ref cur prev
case $prev in
-b|-c|-e|-d|-p|-t)
return 0
;;
-i|-o)
_filedir
return 0
;;
esac
if [[ "$cur" == -* ]]; then
# -w (dangerous) and -X (internal use) not here on purpose
COMPREPLY=( $( compgen -W '-b -c -e -d -f -i -n -o -p -s -t -v' \
-- "$cur" ) )
return 0
fi
cur=${cur:=/dev/}
_filedir
} &&
complete -F _badblocks badblocks
have dumpe2fs &&
_dumpe2fs()
{
COMPREPLY=()
local cur prev
_get_comp_words_by_ref cur prev
case $prev in
-o|-V)
return 0
;;
-i)
_filedir
return 0
;;
esac
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-b -o -f -h -i -x -V' -- "$cur" ) )
return 0
fi
cur=${cur:=/dev/}
_filedir
} &&
complete -F _dumpe2fs dumpe2fs
have e2freefrag &&
_e2freefrag()
{
COMPREPLY=()
local cur prev
_get_comp_words_by_ref cur prev
case $prev in
-c|-h)
return 0
;;
esac
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-c -h' -- "$cur" ) )
return 0
fi
cur=${cur:=/dev/}
_filedir
} &&
complete -F _e2freefrag e2freefrag
have e2label &&
_e2label()
{
COMPREPLY=()
local cur cword
_get_comp_words_by_ref cur cword
if [ $cword -eq 1 ]; then
cur=${cur:=/dev/}
_filedir
fi
} &&
complete -F _e2label e2label
have filefrag &&
_filefrag()
{
COMPREPLY=()
local cur
_get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-B -b -s -v -x' -- "$cur" ) )
return 0
fi
_filedir
} &&
complete -F _filefrag filefrag
have tune2fs &&
_tune2fs()
{
COMPREPLY=()
local cur prev
_get_comp_words_by_ref cur prev
case $prev in
-c|-C|-E|-i|-J|-L|-m|-r|-T)
return 0
;;
-e)
COMPREPLY=( $( compgen -W 'continue remount-ro panic' -- "$cur" ) )
return 0
;;
-g)
_gids
COMPREPLY=( $( compgen -g -W '${COMPREPLY[@]}' -- "$cur" ) )
return 0
;;
-M)
_filedir -d
;;
-o)
local -a opts=(^debug ^bsdgroups ^user_xattr ^acl ^uid16
^journal_data ^journal_data_ordered ^journal_data_writeback)
COMPREPLY=( $( compgen -W '${opts[@]} ${opts[@]#^}' -- "$cur" ) )
return 0
;;
-O)
local -a opts=(^dir_index ^dir_nlink ^extent ^extra_isize ^filetype
^flex_bg ^has_journal ^huge_file ^large_file ^resize_inode
^sparse_super ^uninit_bg)
COMPREPLY=( $( compgen -W '${opts[@]} ${opts[@]#^}' -- "$cur" ) )
return 0
;;
-u)
_uids
COMPREPLY=( $( compgen -u -W '${COMPREPLY[@]}' -- "$cur" ) )
return 0
;;
-U)
COMPREPLY=( $( compgen -W 'clear random time' -- "$cur" ) )
return 0
;;
esac
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-c -C -e -E -f -g -i -j -J -l -L -m -M -o
-O -r -T -u -U' -- "$cur" ) )
fi
cur=${cur:=/dev/}
_filedir
} &&
complete -F _tune2fs tune2fs
# 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