#compdef authoscope

autoload -U is-at-least

_authoscope() {
    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]' \
":: :_authoscope_commands" \
"*::: :->authoscope" \
&& ret=0
    case $state in
    (authoscope)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:authoscope-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-path -- Username list path:_files' \
':passwords-path -- Password list path:_files' \
':scripts -- Scripts to run:_files' \
&& ret=0
;;
(combo)
_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]' \
':path -- Path to combolist:_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
;;
(run)
_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[_authoscope_commands] )) ||
_authoscope_commands() {
    local commands; commands=(
        "dict:For each user try every password from a dictionary/wordlist" \
"combo:Run a credential stuffing attack with a combolist" \
"enum:For each user enumerate if an account exists with that name/email" \
"run:Run a script with a single username and password" \
"fsck:Verify a given input file is properly encoded and all entries have valid formatting" \
"completions:Generate shell completions" \
"help:Prints this message or the help of the given subcommand(s)" \
    )
    _describe -t commands 'authoscope commands' commands "$@"
}
(( $+functions[_authoscope__combo_commands] )) ||
_authoscope__combo_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'authoscope combo commands' commands "$@"
}
(( $+functions[_authoscope__completions_commands] )) ||
_authoscope__completions_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'authoscope completions commands' commands "$@"
}
(( $+functions[_authoscope__dict_commands] )) ||
_authoscope__dict_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'authoscope dict commands' commands "$@"
}
(( $+functions[_authoscope__enum_commands] )) ||
_authoscope__enum_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'authoscope enum commands' commands "$@"
}
(( $+functions[_authoscope__fsck_commands] )) ||
_authoscope__fsck_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'authoscope fsck commands' commands "$@"
}
(( $+functions[_authoscope__help_commands] )) ||
_authoscope__help_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'authoscope help commands' commands "$@"
}
(( $+functions[_authoscope__run_commands] )) ||
_authoscope__run_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'authoscope run commands' commands "$@"
}

_authoscope "$@"