2010-06-21 23:48:18 +03:00
|
|
|
# lrzip(1) completion
|
|
|
|
|
2011-04-05 00:35:51 +03:00
|
|
|
have lrzip || return
|
|
|
|
|
2010-06-21 23:48:18 +03:00
|
|
|
_lrzip()
|
|
|
|
{
|
2011-04-20 22:22:51 +03:00
|
|
|
local cur prev words cword
|
|
|
|
_init_completion || return
|
2010-06-21 23:48:18 +03:00
|
|
|
|
|
|
|
if [[ "$cur" == -* && $prev != -N ]]; then
|
2011-04-28 21:21:31 +03:00
|
|
|
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
|
2010-06-21 23:48:18 +03:00
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
local xspec="*.lrz"
|
|
|
|
|
|
|
|
case $prev in
|
|
|
|
-w|-S|-V|-h)
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
-d)
|
|
|
|
xspec="!"$xspec
|
|
|
|
;;
|
|
|
|
-o)
|
|
|
|
_filedir
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
-O)
|
|
|
|
_filedir -d
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
-L)
|
2011-04-25 23:44:08 +03:00
|
|
|
COMPREPLY=( $( compgen -W '{1..9}' -- "$cur" ) )
|
2010-06-21 23:48:18 +03:00
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
-T)
|
2011-04-25 23:44:08 +03:00
|
|
|
COMPREPLY=( $( compgen -W '{1..10}' -- "$cur" ) )
|
2010-06-21 23:48:18 +03:00
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
-N)
|
2011-04-25 23:44:08 +03:00
|
|
|
COMPREPLY=( $( compgen -W '{-20..19}' -- "$cur" ) )
|
2010-06-21 23:48:18 +03:00
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
_expand || return 0
|
|
|
|
|
2010-10-04 20:49:17 +03:00
|
|
|
local IFS=$'\n'
|
2011-04-21 12:33:05 +03:00
|
|
|
compopt -o filenames
|
2010-06-21 23:48:18 +03:00
|
|
|
COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \
|
|
|
|
$( compgen -d -- "$cur" ) )
|
|
|
|
} &&
|
2010-11-01 19:26:53 +02:00
|
|
|
complete -F _lrzip lrzip
|
2010-06-21 23:48:18 +03:00
|
|
|
|
|
|
|
# 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
|