#compdef ein

autoload -U is-at-least

_ein() {
    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[@]}" : \
'-t+[The number of threads to use. If unset, use all cores, if 0 use all physical cores]:THREADS:_default' \
'--threads=[The number of threads to use. If unset, use all cores, if 0 use all physical cores]:THREADS:_default' \
'-q[Do not display verbose messages and progress information]' \
'--quiet[Do not display verbose messages and progress information]' \
'(-q --quiet)--progress[Bring up a terminal user interface displaying progress visually]' \
'(-q --quiet)--progress-keep-open[The progress TUI will stay up even though the work is already completed]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_ein_commands" \
"*::: :->ein" \
&& ret=0
    case $state in
    (ein)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:ein-command-$line[1]:"
        case $line[1] in
            (init)
_arguments "${_arguments_options[@]}" : \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::directory -- The directory in which to initialize a new git repository:_files' \
&& ret=0
;;
(initialize)
_arguments "${_arguments_options[@]}" : \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::directory -- The directory in which to initialize a new git repository:_files' \
&& ret=0
;;
(tool)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
":: :_ein__tool_commands" \
"*::: :->tool" \
&& ret=0

    case $state in
    (tool)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:ein-tool-command-$line[1]:"
        case $line[1] in
            (find)
_arguments "${_arguments_options[@]}" : \
'-d[If set, print additional information to help understand why the traversal is slow]' \
'--debug[If set, print additional information to help understand why the traversal is slow]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::root -- The directory in which to find all git repositories:_files' \
&& ret=0
;;
(organize)
_arguments "${_arguments_options[@]}" : \
'-f+[The directory to use when finding input repositories to move into position]:REPOSITORY_SOURCE:_files' \
'--repository-source=[The directory to use when finding input repositories to move into position]:REPOSITORY_SOURCE:_files' \
'-t+[The directory to which to move repositories found in the repository-source]:DESTINATION_DIRECTORY:_files' \
'--destination-directory=[The directory to which to move repositories found in the repository-source]:DESTINATION_DIRECTORY:_files' \
'--execute[The operation will be in dry-run mode unless this flag is set]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(estimate-hours)
_arguments "${_arguments_options[@]}" : \
'-b[Ignore github bots which match the \`\[bot\]\` search string]' \
'--no-bots[Ignore github bots which match the \`\[bot\]\` search string]' \
'-f[Collect additional information about file modifications, additions and deletions (without rename tracking)]' \
'--file-stats[Collect additional information about file modifications, additions and deletions (without rename tracking)]' \
'-l[Collect additional information about lines added and deleted (without rename tracking)]' \
'--line-stats[Collect additional information about lines added and deleted (without rename tracking)]' \
'-p[Show personally identifiable information before the summary. Includes names and email addresses]' \
'--show-pii[Show personally identifiable information before the summary. Includes names and email addresses]' \
'-i[Omit unifying identities by name and email which can lead to the same author appear multiple times due to using different names or email addresses]' \
'--omit-unify-identities[Omit unifying identities by name and email which can lead to the same author appear multiple times due to using different names or email addresses]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::working_dir -- The directory containing a '\''.git/'\'' folder:_files' \
'::rev_spec -- The name of the revision as spec, like '\''HEAD'\'' or '\''main'\'' at which to start iterating the commit graph:_default' \
&& ret=0
;;
(h)
_arguments "${_arguments_options[@]}" : \
'-b[Ignore github bots which match the \`\[bot\]\` search string]' \
'--no-bots[Ignore github bots which match the \`\[bot\]\` search string]' \
'-f[Collect additional information about file modifications, additions and deletions (without rename tracking)]' \
'--file-stats[Collect additional information about file modifications, additions and deletions (without rename tracking)]' \
'-l[Collect additional information about lines added and deleted (without rename tracking)]' \
'--line-stats[Collect additional information about lines added and deleted (without rename tracking)]' \
'-p[Show personally identifiable information before the summary. Includes names and email addresses]' \
'--show-pii[Show personally identifiable information before the summary. Includes names and email addresses]' \
'-i[Omit unifying identities by name and email which can lead to the same author appear multiple times due to using different names or email addresses]' \
'--omit-unify-identities[Omit unifying identities by name and email which can lead to the same author appear multiple times due to using different names or email addresses]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::working_dir -- The directory containing a '\''.git/'\'' folder:_files' \
'::rev_spec -- The name of the revision as spec, like '\''HEAD'\'' or '\''main'\'' at which to start iterating the commit graph:_default' \
&& ret=0
;;
(hours)
_arguments "${_arguments_options[@]}" : \
'-b[Ignore github bots which match the \`\[bot\]\` search string]' \
'--no-bots[Ignore github bots which match the \`\[bot\]\` search string]' \
'-f[Collect additional information about file modifications, additions and deletions (without rename tracking)]' \
'--file-stats[Collect additional information about file modifications, additions and deletions (without rename tracking)]' \
'-l[Collect additional information about lines added and deleted (without rename tracking)]' \
'--line-stats[Collect additional information about lines added and deleted (without rename tracking)]' \
'-p[Show personally identifiable information before the summary. Includes names and email addresses]' \
'--show-pii[Show personally identifiable information before the summary. Includes names and email addresses]' \
'-i[Omit unifying identities by name and email which can lead to the same author appear multiple times due to using different names or email addresses]' \
'--omit-unify-identities[Omit unifying identities by name and email which can lead to the same author appear multiple times due to using different names or email addresses]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::working_dir -- The directory containing a '\''.git/'\'' folder:_files' \
'::rev_spec -- The name of the revision as spec, like '\''HEAD'\'' or '\''main'\'' at which to start iterating the commit graph:_default' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_ein__tool__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:ein-tool-help-command-$line[1]:"
        case $line[1] in
            (find)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(organize)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(estimate-hours)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(t)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
":: :_ein__tool_commands" \
"*::: :->tool" \
&& ret=0

    case $state in
    (tool)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:ein-tool-command-$line[1]:"
        case $line[1] in
            (find)
_arguments "${_arguments_options[@]}" : \
'-d[If set, print additional information to help understand why the traversal is slow]' \
'--debug[If set, print additional information to help understand why the traversal is slow]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::root -- The directory in which to find all git repositories:_files' \
&& ret=0
;;
(organize)
_arguments "${_arguments_options[@]}" : \
'-f+[The directory to use when finding input repositories to move into position]:REPOSITORY_SOURCE:_files' \
'--repository-source=[The directory to use when finding input repositories to move into position]:REPOSITORY_SOURCE:_files' \
'-t+[The directory to which to move repositories found in the repository-source]:DESTINATION_DIRECTORY:_files' \
'--destination-directory=[The directory to which to move repositories found in the repository-source]:DESTINATION_DIRECTORY:_files' \
'--execute[The operation will be in dry-run mode unless this flag is set]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(estimate-hours)
_arguments "${_arguments_options[@]}" : \
'-b[Ignore github bots which match the \`\[bot\]\` search string]' \
'--no-bots[Ignore github bots which match the \`\[bot\]\` search string]' \
'-f[Collect additional information about file modifications, additions and deletions (without rename tracking)]' \
'--file-stats[Collect additional information about file modifications, additions and deletions (without rename tracking)]' \
'-l[Collect additional information about lines added and deleted (without rename tracking)]' \
'--line-stats[Collect additional information about lines added and deleted (without rename tracking)]' \
'-p[Show personally identifiable information before the summary. Includes names and email addresses]' \
'--show-pii[Show personally identifiable information before the summary. Includes names and email addresses]' \
'-i[Omit unifying identities by name and email which can lead to the same author appear multiple times due to using different names or email addresses]' \
'--omit-unify-identities[Omit unifying identities by name and email which can lead to the same author appear multiple times due to using different names or email addresses]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::working_dir -- The directory containing a '\''.git/'\'' folder:_files' \
'::rev_spec -- The name of the revision as spec, like '\''HEAD'\'' or '\''main'\'' at which to start iterating the commit graph:_default' \
&& ret=0
;;
(h)
_arguments "${_arguments_options[@]}" : \
'-b[Ignore github bots which match the \`\[bot\]\` search string]' \
'--no-bots[Ignore github bots which match the \`\[bot\]\` search string]' \
'-f[Collect additional information about file modifications, additions and deletions (without rename tracking)]' \
'--file-stats[Collect additional information about file modifications, additions and deletions (without rename tracking)]' \
'-l[Collect additional information about lines added and deleted (without rename tracking)]' \
'--line-stats[Collect additional information about lines added and deleted (without rename tracking)]' \
'-p[Show personally identifiable information before the summary. Includes names and email addresses]' \
'--show-pii[Show personally identifiable information before the summary. Includes names and email addresses]' \
'-i[Omit unifying identities by name and email which can lead to the same author appear multiple times due to using different names or email addresses]' \
'--omit-unify-identities[Omit unifying identities by name and email which can lead to the same author appear multiple times due to using different names or email addresses]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::working_dir -- The directory containing a '\''.git/'\'' folder:_files' \
'::rev_spec -- The name of the revision as spec, like '\''HEAD'\'' or '\''main'\'' at which to start iterating the commit graph:_default' \
&& ret=0
;;
(hours)
_arguments "${_arguments_options[@]}" : \
'-b[Ignore github bots which match the \`\[bot\]\` search string]' \
'--no-bots[Ignore github bots which match the \`\[bot\]\` search string]' \
'-f[Collect additional information about file modifications, additions and deletions (without rename tracking)]' \
'--file-stats[Collect additional information about file modifications, additions and deletions (without rename tracking)]' \
'-l[Collect additional information about lines added and deleted (without rename tracking)]' \
'--line-stats[Collect additional information about lines added and deleted (without rename tracking)]' \
'-p[Show personally identifiable information before the summary. Includes names and email addresses]' \
'--show-pii[Show personally identifiable information before the summary. Includes names and email addresses]' \
'-i[Omit unifying identities by name and email which can lead to the same author appear multiple times due to using different names or email addresses]' \
'--omit-unify-identities[Omit unifying identities by name and email which can lead to the same author appear multiple times due to using different names or email addresses]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::working_dir -- The directory containing a '\''.git/'\'' folder:_files' \
'::rev_spec -- The name of the revision as spec, like '\''HEAD'\'' or '\''main'\'' at which to start iterating the commit graph:_default' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_ein__tool__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:ein-tool-help-command-$line[1]:"
        case $line[1] in
            (find)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(organize)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(estimate-hours)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(completions)
_arguments "${_arguments_options[@]}" : \
'-s+[The shell to generate completions for. Otherwise it'\''s derived from the environment]:SHELL:(bash elvish fish powershell zsh)' \
'--shell=[The shell to generate completions for. Otherwise it'\''s derived from the environment]:SHELL:(bash elvish fish powershell zsh)' \
'-h[Print help]' \
'--help[Print help]' \
'::out_dir -- The output directory in case multiple files are generated. If not provided, will write to stdout:_default' \
&& ret=0
;;
(generate-completions)
_arguments "${_arguments_options[@]}" : \
'-s+[The shell to generate completions for. Otherwise it'\''s derived from the environment]:SHELL:(bash elvish fish powershell zsh)' \
'--shell=[The shell to generate completions for. Otherwise it'\''s derived from the environment]:SHELL:(bash elvish fish powershell zsh)' \
'-h[Print help]' \
'--help[Print help]' \
'::out_dir -- The output directory in case multiple files are generated. If not provided, will write to stdout:_default' \
&& ret=0
;;
(shell-completions)
_arguments "${_arguments_options[@]}" : \
'-s+[The shell to generate completions for. Otherwise it'\''s derived from the environment]:SHELL:(bash elvish fish powershell zsh)' \
'--shell=[The shell to generate completions for. Otherwise it'\''s derived from the environment]:SHELL:(bash elvish fish powershell zsh)' \
'-h[Print help]' \
'--help[Print help]' \
'::out_dir -- The output directory in case multiple files are generated. If not provided, will write to stdout:_default' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_ein__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:ein-help-command-$line[1]:"
        case $line[1] in
            (init)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(tool)
_arguments "${_arguments_options[@]}" : \
":: :_ein__help__tool_commands" \
"*::: :->tool" \
&& ret=0

    case $state in
    (tool)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:ein-help-tool-command-$line[1]:"
        case $line[1] in
            (find)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(organize)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(estimate-hours)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
(completions)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
}

(( $+functions[_ein_commands] )) ||
_ein_commands() {
    local commands; commands=(
'init:Initialize the repository in the current directory' \
'initialize:Initialize the repository in the current directory' \
'tool:A selection of useful tools' \
't:A selection of useful tools' \
'completions:Generate shell completions to stdout or a directory' \
'generate-completions:Generate shell completions to stdout or a directory' \
'shell-completions:Generate shell completions to stdout or a directory' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'ein commands' commands "$@"
}
(( $+functions[_ein__completions_commands] )) ||
_ein__completions_commands() {
    local commands; commands=()
    _describe -t commands 'ein completions commands' commands "$@"
}
(( $+functions[_ein__help_commands] )) ||
_ein__help_commands() {
    local commands; commands=(
'init:Initialize the repository in the current directory' \
'tool:A selection of useful tools' \
'completions:Generate shell completions to stdout or a directory' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'ein help commands' commands "$@"
}
(( $+functions[_ein__help__completions_commands] )) ||
_ein__help__completions_commands() {
    local commands; commands=()
    _describe -t commands 'ein help completions commands' commands "$@"
}
(( $+functions[_ein__help__help_commands] )) ||
_ein__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'ein help help commands' commands "$@"
}
(( $+functions[_ein__help__init_commands] )) ||
_ein__help__init_commands() {
    local commands; commands=()
    _describe -t commands 'ein help init commands' commands "$@"
}
(( $+functions[_ein__help__tool_commands] )) ||
_ein__help__tool_commands() {
    local commands; commands=(
'find:Find all repositories in a given directory' \
'organize:Move all repositories found in a directory into a structure matching their clone URLs' \
'estimate-hours:Estimate hours worked based on a commit history' \
    )
    _describe -t commands 'ein help tool commands' commands "$@"
}
(( $+functions[_ein__help__tool__estimate-hours_commands] )) ||
_ein__help__tool__estimate-hours_commands() {
    local commands; commands=()
    _describe -t commands 'ein help tool estimate-hours commands' commands "$@"
}
(( $+functions[_ein__help__tool__find_commands] )) ||
_ein__help__tool__find_commands() {
    local commands; commands=()
    _describe -t commands 'ein help tool find commands' commands "$@"
}
(( $+functions[_ein__help__tool__organize_commands] )) ||
_ein__help__tool__organize_commands() {
    local commands; commands=()
    _describe -t commands 'ein help tool organize commands' commands "$@"
}
(( $+functions[_ein__init_commands] )) ||
_ein__init_commands() {
    local commands; commands=()
    _describe -t commands 'ein init commands' commands "$@"
}
(( $+functions[_ein__tool_commands] )) ||
_ein__tool_commands() {
    local commands; commands=(
'find:Find all repositories in a given directory' \
'organize:Move all repositories found in a directory into a structure matching their clone URLs' \
'estimate-hours:Estimate hours worked based on a commit history' \
'h:Estimate hours worked based on a commit history' \
'hours:Estimate hours worked based on a commit history' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'ein tool commands' commands "$@"
}
(( $+functions[_ein__tool__estimate-hours_commands] )) ||
_ein__tool__estimate-hours_commands() {
    local commands; commands=()
    _describe -t commands 'ein tool estimate-hours commands' commands "$@"
}
(( $+functions[_ein__tool__find_commands] )) ||
_ein__tool__find_commands() {
    local commands; commands=()
    _describe -t commands 'ein tool find commands' commands "$@"
}
(( $+functions[_ein__tool__help_commands] )) ||
_ein__tool__help_commands() {
    local commands; commands=(
'find:Find all repositories in a given directory' \
'organize:Move all repositories found in a directory into a structure matching their clone URLs' \
'estimate-hours:Estimate hours worked based on a commit history' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'ein tool help commands' commands "$@"
}
(( $+functions[_ein__tool__help__estimate-hours_commands] )) ||
_ein__tool__help__estimate-hours_commands() {
    local commands; commands=()
    _describe -t commands 'ein tool help estimate-hours commands' commands "$@"
}
(( $+functions[_ein__tool__help__find_commands] )) ||
_ein__tool__help__find_commands() {
    local commands; commands=()
    _describe -t commands 'ein tool help find commands' commands "$@"
}
(( $+functions[_ein__tool__help__help_commands] )) ||
_ein__tool__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'ein tool help help commands' commands "$@"
}
(( $+functions[_ein__tool__help__organize_commands] )) ||
_ein__tool__help__organize_commands() {
    local commands; commands=()
    _describe -t commands 'ein tool help organize commands' commands "$@"
}
(( $+functions[_ein__tool__organize_commands] )) ||
_ein__tool__organize_commands() {
    local commands; commands=()
    _describe -t commands 'ein tool organize commands' commands "$@"
}

if [ "$funcstack[1]" = "_ein" ]; then
    _ein "$@"
else
    compdef _ein ein
fi
