# lrzip(1) completion -*- shell-script -*- proc _lrzip { local cur prev words cword _init_completion || return local xspec="*.lrz" match $prev { with -w|-S|-V|-h|-'?' return 0 with -d setglobal xspec = ""!"$xspec" with -o _filedir return 0 with -O _filedir -d return 0 with -L setglobal COMPREPLY = ''( $( compgen -W '{1..9}' -- "$cur" ) ) return 0 with -N setglobal COMPREPLY = ''( $( compgen -W '{-20..19}' -- "$cur" ) ) return 0 with -p setglobal COMPREPLY = ''( $( compgen -W "{1..$(_ncpus)}" -- "$cur" ) ) return 0 } _expand || return 0 if [[ "$cur" == -* ]] { setglobal COMPREPLY = ''( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) return 0 } local IFS=$'\n' compopt -o filenames setglobal COMPREPLY = ''( $( compgen -f -X "$xspec" -- "$cur" ) \ $( compgen -d -- "$cur" ) ) } && complete -F _lrzip lrzip # ex: ts=4 sw=4 et filetype=sh