#compdef roast-scm

autoload -U is-at-least

_roast-scm() {
    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[@]}" : \
'-C+[Whether to generate or update a changelog file or not.]:CHANGESGENERATE:(true false)' \
'--changesgenerate=[Whether to generate or update a changelog file or not.]:CHANGESGENERATE:(true false)' \
'-A+[Author to include during the changelog generation.]:CHANGESAUTHOR:_default' \
'--changesauthor=[Author to include during the changelog generation.]:CHANGESAUTHOR:_default' \
'-e+[Email of author to include during the changelog generation.]:CHANGESEMAIL:_default' \
'--changesemail=[Email of author to include during the changelog generation.]:CHANGESEMAIL:_default' \
'--changesoutfile=[Whether to specify a path to the changes file. Otherwise, it is the current directory and the filename is the same filename prefix of the generated tarball e.g. \`source.tar.xz\` will have \`source.changes\` file. If file exists, it prepends the newest changes to the top-most part of the text file.]:CHANGESOUTFILE:_files' \
'--set-version=[Whether to hard code the version or not. Set it to hard code one, otherwise, it will use the generated version internally.]:SET_VERSION:_default' \
'--set-name=[Whether to hard code the name or not. Set it to hard code one, otherwise, it will use the generated name internally.]:SET_NAME:_default' \
'-U+[Remote URL to the git repository.]:GIT_REPOSITORY_URL:_default' \
'--git-repository-url=[Remote URL to the git repository.]:GIT_REPOSITORY_URL:_default' \
'*-E+[Additional paths such as files or directories from within target repository'\''s work directory to exclude when generating the archive.]:EXCLUDE:_files' \
'*--exclude=[Additional paths such as files or directories from within target repository'\''s work directory to exclude when generating the archive.]:EXCLUDE:_files' \
'--revision=[Revision or tag. It can also be a specific commit hash or branch. Supports <https\://git-scm.com/docs/git-rev-parse.html#_specifying_revisions>.]:REVISION:_default' \
'--versionrewriteregex=[Pass a regex with capture groups. Required by \`versionrewritepattern\` flag. Each capture group is labelled through increments of 1.]:VERSIONREWRITEREGEX:_default' \
'--versionrewritepattern=[Pass a pattern from the capture groups from \`versionrewriteregex\` flag.]:VERSIONREWRITEPATTERN:_default' \
'--depth=[The depth of cloning the repository.]:DEPTH:_default' \
'--is-temporary=[Whether the cloned repository should be deleted or not after the operation.]:IS_TEMPORARY:(true false)' \
'-f+[Output file of the generated archive with path. If not provided, attempts to write the filename based on project name and revision based on <https\://en.opensuse.org/openSUSE\:Package_versioning_guidelines>.]:OUTFILE:_files' \
'--outfile=[Output file of the generated archive with path. If not provided, attempts to write the filename based on project name and revision based on <https\://en.opensuse.org/openSUSE\:Package_versioning_guidelines>.]:OUTFILE:_files' \
'-d+[Output path of the generated archive.]:OUTDIR:_files' \
'--outdir=[Output path of the generated archive.]:OUTDIR:_files' \
'-r+[Allow reproducibility for Reproducible Builds.]:REPRODUCIBLE:(true false)' \
'--reproducible=[Allow reproducibility for Reproducible Builds.]:REPRODUCIBLE:(true false)' \
'-g+[Whether to ignore git related metadata, files and directories.]:IGNORE_GIT:(true false)' \
'--ignore-git=[Whether to ignore git related metadata, files and directories.]:IGNORE_GIT:(true false)' \
'-I+[Whether to ignore hidden directories and files or what we call dotfiles. Does not affect \`--ignore-git\`.]:IGNORE_HIDDEN:(true false)' \
'--ignore-hidden=[Whether to ignore hidden directories and files or what we call dotfiles. Does not affect \`--ignore-git\`.]:IGNORE_HIDDEN:(true false)' \
'-c+[Compression to use.]:COMPRESSION:(gz xz zst zstd bz2 not)' \
'--compression=[Compression to use.]:COMPRESSION:(gz xz zst zstd bz2 not)' \
'-S+[Whether to silence the output or not.]:SILENT:(true false)' \
'--silent=[Whether to silence the output or not.]:SILENT:(true false)' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_roast-scm_commands" \
"*::: :->roast-scm" \
&& ret=0
    case $state in
    (roast-scm)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:roast-scm-command-$line[1]:"
        case $line[1] in
            (generate-completions-for)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
':shell:(bash elvish fish powershell zsh)' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_roast-scm__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:roast-scm-help-command-$line[1]:"
        case $line[1] in
            (generate-completions-for)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
}

(( $+functions[_roast-scm_commands] )) ||
_roast-scm_commands() {
    local commands; commands=(
'generate-completions-for:Generate shell completions' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'roast-scm commands' commands "$@"
}
(( $+functions[_roast-scm__generate-completions-for_commands] )) ||
_roast-scm__generate-completions-for_commands() {
    local commands; commands=()
    _describe -t commands 'roast-scm generate-completions-for commands' commands "$@"
}
(( $+functions[_roast-scm__help_commands] )) ||
_roast-scm__help_commands() {
    local commands; commands=(
'generate-completions-for:Generate shell completions' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'roast-scm help commands' commands "$@"
}
(( $+functions[_roast-scm__help__generate-completions-for_commands] )) ||
_roast-scm__help__generate-completions-for_commands() {
    local commands; commands=()
    _describe -t commands 'roast-scm help generate-completions-for commands' commands "$@"
}
(( $+functions[_roast-scm__help__help_commands] )) ||
_roast-scm__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'roast-scm help help commands' commands "$@"
}

if [ "$funcstack[1]" = "_roast-scm" ]; then
    _roast-scm "$@"
else
    compdef _roast-scm roast-scm
fi
