2011-11-01 22:14:45 +02:00
|
|
|
# lrzip(1) completion -*- shell-script -*-
|
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
|
|
|
|
|
|
|
local xspec="*.lrz"
|
|
|
|
|
|
|
|
case $prev in
|
2011-09-21 20:29:41 +03:00
|
|
|
-w|-S|-V|-h|-'?')
|
2010-06-21 23:48:18 +03:00
|
|
|
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
|
|
|
|
;;
|
|
|
|
-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
|
|
|
|
;;
|
2011-09-21 20:29:41 +03:00
|
|
|
-p)
|
2011-11-09 18:35:13 +02:00
|
|
|
COMPREPLY=( $( compgen -W "{1..$(_ncpus)}" -- "$cur" ) )
|
2011-09-21 20:29:41 +03:00
|
|
|
return 0
|
|
|
|
;;
|
2010-06-21 23:48:18 +03:00
|
|
|
esac
|
|
|
|
|
|
|
|
_expand || return 0
|
|
|
|
|
2011-06-08 21:57:54 +03:00
|
|
|
if [[ "$cur" == -* ]]; then
|
|
|
|
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
|
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
|
|
|
|
|
|
|
# ex: ts=4 sw=4 et filetype=sh
|