#compdef badtouch

autoload -U is-at-least

_badtouch() {
    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[@]}" \
'-n+[Concurrent workers]' \
'--workers=[Concurrent workers]' \
'-o+[Write results to file]' \
'--output=[Write results to file]' \
'*-v[Verbose output]' \
'*--verbose[Verbose output]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
":: :_badtouch_commands" \
"*::: :->badtouch" \
&& ret=0
    case $state in
    (badtouch)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:badtouch-command-$line[1]:"
        case $line[1] in
            (dict)
_arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
'*-v[Verbose output]' \
'*--verbose[Verbose output]' \
':users -- Username list path:_files' \
':passwords -- Password list path:_files' \
':scripts -- Scripts to run:_files' \
&& ret=0
;;
(creds)
_arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
'*-v[Verbose output]' \
'*--verbose[Verbose output]' \
':creds -- Credential list path:_files' \
':scripts -- Scripts to run:_files' \
&& ret=0
;;
(enum)
_arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
'*-v[Verbose output]' \
'*--verbose[Verbose output]' \
':users -- Username list path:_files' \
':scripts -- Scripts to run:_files' \
&& ret=0
;;
(oneshot)
_arguments "${_arguments_options[@]}" \
'-x[Set the exitcode to 2 if the credentials are invalid]' \
'--exitcode[Set the exitcode to 2 if the credentials are invalid]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
'*-v[Verbose output]' \
'*--verbose[Verbose output]' \
':script -- Script to run:_files' \
':user -- Username to test:_files' \
'::password -- Password to test:_files' \
&& ret=0
;;
(fsck)
_arguments "${_arguments_options[@]}" \
'-q[Do not show invalid lines]' \
'--quiet[Do not show invalid lines]' \
'-s[Do not show valid lines]' \
'--silent[Do not show valid lines]' \
'-c[Require one colon per line]' \
'--colon[Require one colon per line]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
'*-v[Verbose output]' \
'*--verbose[Verbose output]' \
'::paths -- Files to read:_files' \
&& ret=0
;;
(completions)
_arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
'*-v[Verbose output]' \
'*--verbose[Verbose output]' \
':shell:(zsh bash fish powershell elvish)' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
'*-v[Verbose output]' \
'*--verbose[Verbose output]' \
&& ret=0
;;
        esac
    ;;
esac
}

(( $+functions[_badtouch_commands] )) ||
_badtouch_commands() {
    local commands; commands=(
        "dict:Dictionary attack" \
"creds:Credential confirmation attack" \
"enum:Enumerate users" \
"oneshot:Test a single username-password combination" \
"fsck:Verify and fix encoding of a list" \
"completions:Generate shell completions" \
"help:Prints this message or the help of the given subcommand(s)" \
    )
    _describe -t commands 'badtouch commands' commands "$@"
}
(( $+functions[_badtouch__completions_commands] )) ||
_badtouch__completions_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'badtouch completions commands' commands "$@"
}
(( $+functions[_badtouch__creds_commands] )) ||
_badtouch__creds_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'badtouch creds commands' commands "$@"
}
(( $+functions[_badtouch__dict_commands] )) ||
_badtouch__dict_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'badtouch dict commands' commands "$@"
}
(( $+functions[_badtouch__enum_commands] )) ||
_badtouch__enum_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'badtouch enum commands' commands "$@"
}
(( $+functions[_badtouch__fsck_commands] )) ||
_badtouch__fsck_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'badtouch fsck commands' commands "$@"
}
(( $+functions[_badtouch__help_commands] )) ||
_badtouch__help_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'badtouch help commands' commands "$@"
}
(( $+functions[_badtouch__oneshot_commands] )) ||
_badtouch__oneshot_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'badtouch oneshot commands' commands "$@"
}

_badtouch "$@"