# lzip(1) completion -*- shell-script -*- proc _lzip { local cur prev words cword split _init_completion -s || return local decompress=false match $prev { with -h|--help|-V|--version|-b|--member-size|-m|--match-length|\ -s|--dictionary-size|-S|--volume-size|-B|--data-size return with -d|--decompress setglobal decompress = 'true' with -n|--threads setglobal COMPREPLY = ''( $( compgen -W "{1..$(_ncpus)}" -- "$cur" ) ) return with -o|--output _filedir return } $split && return if [[ "$cur" == -* ]] { setglobal COMPREPLY = ''( $( compgen -W '$( _parse_help "$1" ) {-1..-9}' \ -- "$cur" ) ) [[ $COMPREPLY == *= ]] && compopt -o nospace return } if $decompress { _filedir lz return } local IFS=$'\n' compopt -o filenames setglobal COMPREPLY = ''( $( compgen -f -X "*.lz" -- "$cur" ) \ $( compgen -d -- "$cur" ) ) } && complete -F _lzip clzip lzip pdlzip plzip # ex: ts=4 sw=4 et filetype=sh