#compdef teip

autoload -U is-at-least

_teip() {
    typeset -A opt_args
    typeset -a _arguments_options
    local ret=1

    if is-at-least 5.2; then
        _arguments_options=(-s -S -C)
    else
        _arguments_options=(-s -C)
    fi

    local context curcontext="$curcontext" state line
    _arguments "${_arguments_options[@]}" \
'-g+[Bypassing lines that match the regular expression <pattern>]' \
'-f+[Bypassing these white-space separated fields]' \
'-d+[Use <delimiter> for field delimiter of -f]' \
'-D+[Use regular expression <pattern> for field delimiter of -f]' \
'-c+[Bypassing these characters]' \
'-l+[Bypassing those lines]' \
'-I+[Replace the <replace-str> with bypassed chunk in the <command> then -s is forcefully enabled.]' \
'-e+[Execute <string> on another process that will receive identical standard input as the teip, and numbers given by the result are used as line numbers for bypassing]' \
'-A+[Alias of -e '\''grep -n -A <number> <pattern>'\'']' \
'-B+[Alias of -e '\''grep -n -B <number> <pattern>'\'']' \
'-C+[Alias of -e '\''grep -n -C <number> <pattern>'\'']' \
'--sed=[Alias of -e '\''sed -n "<pattern>="'\'']' \
'--awk=[Alias of -e '\''awk "<pattern>{print NR}"'\'']' \
'--completion=[]' \
'-o[-g bypasses only matched parts]' \
'-G[-g interprets Oniguruma regular expressions.]' \
'--csv[-f interprets <list> as field number of a CSV according to RFC 4180, instead of white-space separated fields]' \
'--unko[]' \
'-s[Execute new command for each bypassed chunk]' \
'--chomp[Command spawned by -s receives standard input without trailing newlines]' \
'-v[Invert the range of bypassing]' \
'-z[Line delimiter is NUL instead of a newline]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
'::command:_files' \
&& ret=0
    
}

(( $+functions[_teip_commands] )) ||
_teip_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'teip commands' commands "$@"
}

_teip "$@"