#compdef freebsd-rustdate

autoload -U is-at-least

_freebsd-rustdate() {
    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+[Config file]:CONFIG:_files' \
'--config=[Config file]:CONFIG:_files' \
'--as-version=[Act as if we'\''re running a given version]:as-version:_default' \
'-j+[How many CPU-bound threads to run in parallel (default numcpu up to 6)]:JOBS_CPU:_default' \
'--jobs-cpu=[How many CPU-bound threads to run in parallel (default numcpu up to 6)]:JOBS_CPU:_default' \
'-J+[How many network request to do in parallel (default 4)]:JOBS_NET:_default' \
'--jobs-net=[How many network request to do in parallel (default 4)]:JOBS_NET:_default' \
'-b+[Operate on system mounted on a given basedir]:BASEDIR:_files -/' \
'--basedir=[Operate on system mounted on a given basedir]:BASEDIR:_files -/' \
'-w+[Store working files in workdir]:WORKDIR:_files -/' \
'--workdir=[Store working files in workdir]:WORKDIR:_files -/' \
'-s+[Server to fetch updates from]:server:_hosts' \
'--server=[Server to fetch updates from]:server:_hosts' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_freebsd-rustdate_commands" \
"*::: :->freebsd-rustdate" \
&& ret=0
    case $state in
    (freebsd-rustdate)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:freebsd-rustdate-command-$line[1]:"
        case $line[1] in
            (fetch)
_arguments "${_arguments_options[@]}" : \
'--as-cron[Run as a backend via \`\$0 cron\`]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(cron)
_arguments "${_arguments_options[@]}" : \
'--immediately[Run without delay.  This is a hidden option to make dev easier]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(upgrade)
_arguments "${_arguments_options[@]}" : \
'-r+[Release to upgrade to (e.g., 13.2-RELEASE)]:RELEASE:_default' \
'--release=[Release to upgrade to (e.g., 13.2-RELEASE)]:RELEASE:_default' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(install)
_arguments "${_arguments_options[@]}" : \
'-n[Just say what we'\''d do, don'\''t actually do it.]' \
'--dry-run[Just say what we'\''d do, don'\''t actually do it.]' \
'-a[Proceed through all steps of installing an Upgrade]' \
'--all[Proceed through all steps of installing an Upgrade]' \
'-s[Don'\''t fsync() files during the install]' \
'--no-sync[Don'\''t fsync() files during the install]' \
'-j[Install files in parallel]' \
'--parallel[Install files in parallel]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(show-install)
_arguments "${_arguments_options[@]}" : \
'*-v+[Show full details (e.g., file lists)]:VERBOSE:((all\:"All types"
add\:"Added files"
rm\:"Removed files"
update\:"Updated files"
change\:"Paths with changed type"
merge\:"Merged files"))' \
'*--verbose=[Show full details (e.g., file lists)]:VERBOSE:((all\:"All types"
add\:"Added files"
rm\:"Removed files"
update\:"Updated files"
change\:"Paths with changed type"
merge\:"Merged files"))' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(show-merges)
_arguments "${_arguments_options[@]}" : \
'-u[Show diffs relative to new upstream instead of your current file]' \
'--upstream[Show diffs relative to new upstream instead of your current file]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(resolve-merges)
_arguments "${_arguments_options[@]}" : \
'-e[Don'\''t attempt resolution, just describe our state and exit]' \
'--exit[Don'\''t attempt resolution, just describe our state and exit]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(clean)
_arguments "${_arguments_options[@]}" : \
'-p[Clean up info about a pending update (i.e., erase knowledge of a previous \`fetch\` or \`upgrade\`)]' \
'--pending[Clean up info about a pending update (i.e., erase knowledge of a previous \`fetch\` or \`upgrade\`)]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(check-sys)
_arguments "${_arguments_options[@]}" : \
'*-i+[Ignore differences of some type (can be specified multiple times)]:IGNORE:((uid\:"Owning user"
gid\:"Owning group"
mode\:"Mode"
flags\:"Flags"
hash\:"File hash"
target\:"Link target"
missing\:"Missing files"
type\:"Mismatched file types"))' \
'*--ignore=[Ignore differences of some type (can be specified multiple times)]:IGNORE:((uid\:"Owning user"
gid\:"Owning group"
mode\:"Mode"
flags\:"Flags"
hash\:"File hash"
target\:"Link target"
missing\:"Missing files"
type\:"Mismatched file types"))' \
'*-p+[Include only matching paths (regex)]:PATHS:_default' \
'*--paths=[Include only matching paths (regex)]:PATHS:_default' \
'*-x+[Exclude paths (regex)]:EXCLUDE:_default' \
'*--exclude=[Exclude paths (regex)]:EXCLUDE:_default' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(check-fetch)
_arguments "${_arguments_options[@]}" : \
'*-q[Run quietly]' \
'*--quiet[Run quietly]' \
'-c[Add a random delay to run via cron]' \
'--cron[Add a random delay to run via cron]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(extract)
_arguments "${_arguments_options[@]}" : \
'-n[Just say what we'\''d do, don'\''t actually do it]' \
'--dry-run[Just say what we'\''d do, don'\''t actually do it]' \
'-x[Treat given paths as regular expressions instead of literals]' \
'--regex[Treat given paths as regular expressions instead of literals]' \
'-c[Attempt to filter down to installed components]' \
'--only-components[Attempt to filter down to installed components]' \
'-f[Forcibly overwrite existing files, even if they look the same]' \
'--force[Forcibly overwrite existing files, even if they look the same]' \
'-s[Don'\''t fsync() files during the install]' \
'--no-sync[Don'\''t fsync() files during the install]' \
'-j[Install files in parallel]' \
'--parallel[Install files in parallel]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'*::paths -- Some number of path\[s\] to work with:_files' \
&& ret=0
;;
(complete)
_arguments "${_arguments_options[@]}" : \
'-s+[Shell to generate completions for]:SHELL:(bash elvish fish powershell zsh)' \
'--shell=[Shell to generate completions for]:SHELL:(bash elvish fish powershell zsh)' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(dump-metadata)
_arguments "${_arguments_options[@]}" : \
'-v+[Version to dump metadata for (e.g., 13.2-RELEASE)]:VERSION:_default' \
'--version=[Version to dump metadata for (e.g., 13.2-RELEASE)]:VERSION:_default' \
'-d+[Directory to save the files into (must exist)]:DIR:_files -/' \
'--dir=[Directory to save the files into (must exist)]:DIR:_files -/' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_freebsd-rustdate__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:freebsd-rustdate-help-command-$line[1]:"
        case $line[1] in
            (fetch)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(cron)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(upgrade)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(install)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(show-install)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(show-merges)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(resolve-merges)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(clean)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(check-sys)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(check-fetch)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(extract)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(complete)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(dump-metadata)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
}

(( $+functions[_freebsd-rustdate_commands] )) ||
_freebsd-rustdate_commands() {
    local commands; commands=(
'fetch:Fetch updates to current version' \
'cron:Fetch updates to current version via cron' \
'upgrade:Fetch upgrades to a new version' \
'install:Install downloaded updates or upgrades' \
'show-install:Show information about a pending install' \
'show-merges:Show merged files from a pending upgrade' \
'resolve-merges:Resolve conflicted merges for a pending upgrade' \
'clean:Clean up stuff (not all stuff included)' \
'check-sys:Check current system state against upstream expectation' \
'check-fetch:Quick check of whether there might be a newer patch available' \
'extract:Extract a file or subtree exactly from upstream' \
'complete:Generate command completions for a given shell' \
'dump-metadata:Dump out metadata info for a version.  (DEV)' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'freebsd-rustdate commands' commands "$@"
}
(( $+functions[_freebsd-rustdate__check-fetch_commands] )) ||
_freebsd-rustdate__check-fetch_commands() {
    local commands; commands=()
    _describe -t commands 'freebsd-rustdate check-fetch commands' commands "$@"
}
(( $+functions[_freebsd-rustdate__check-sys_commands] )) ||
_freebsd-rustdate__check-sys_commands() {
    local commands; commands=()
    _describe -t commands 'freebsd-rustdate check-sys commands' commands "$@"
}
(( $+functions[_freebsd-rustdate__clean_commands] )) ||
_freebsd-rustdate__clean_commands() {
    local commands; commands=()
    _describe -t commands 'freebsd-rustdate clean commands' commands "$@"
}
(( $+functions[_freebsd-rustdate__complete_commands] )) ||
_freebsd-rustdate__complete_commands() {
    local commands; commands=()
    _describe -t commands 'freebsd-rustdate complete commands' commands "$@"
}
(( $+functions[_freebsd-rustdate__cron_commands] )) ||
_freebsd-rustdate__cron_commands() {
    local commands; commands=()
    _describe -t commands 'freebsd-rustdate cron commands' commands "$@"
}
(( $+functions[_freebsd-rustdate__dump-metadata_commands] )) ||
_freebsd-rustdate__dump-metadata_commands() {
    local commands; commands=()
    _describe -t commands 'freebsd-rustdate dump-metadata commands' commands "$@"
}
(( $+functions[_freebsd-rustdate__extract_commands] )) ||
_freebsd-rustdate__extract_commands() {
    local commands; commands=()
    _describe -t commands 'freebsd-rustdate extract commands' commands "$@"
}
(( $+functions[_freebsd-rustdate__fetch_commands] )) ||
_freebsd-rustdate__fetch_commands() {
    local commands; commands=()
    _describe -t commands 'freebsd-rustdate fetch commands' commands "$@"
}
(( $+functions[_freebsd-rustdate__help_commands] )) ||
_freebsd-rustdate__help_commands() {
    local commands; commands=(
'fetch:Fetch updates to current version' \
'cron:Fetch updates to current version via cron' \
'upgrade:Fetch upgrades to a new version' \
'install:Install downloaded updates or upgrades' \
'show-install:Show information about a pending install' \
'show-merges:Show merged files from a pending upgrade' \
'resolve-merges:Resolve conflicted merges for a pending upgrade' \
'clean:Clean up stuff (not all stuff included)' \
'check-sys:Check current system state against upstream expectation' \
'check-fetch:Quick check of whether there might be a newer patch available' \
'extract:Extract a file or subtree exactly from upstream' \
'complete:Generate command completions for a given shell' \
'dump-metadata:Dump out metadata info for a version.  (DEV)' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'freebsd-rustdate help commands' commands "$@"
}
(( $+functions[_freebsd-rustdate__help__check-fetch_commands] )) ||
_freebsd-rustdate__help__check-fetch_commands() {
    local commands; commands=()
    _describe -t commands 'freebsd-rustdate help check-fetch commands' commands "$@"
}
(( $+functions[_freebsd-rustdate__help__check-sys_commands] )) ||
_freebsd-rustdate__help__check-sys_commands() {
    local commands; commands=()
    _describe -t commands 'freebsd-rustdate help check-sys commands' commands "$@"
}
(( $+functions[_freebsd-rustdate__help__clean_commands] )) ||
_freebsd-rustdate__help__clean_commands() {
    local commands; commands=()
    _describe -t commands 'freebsd-rustdate help clean commands' commands "$@"
}
(( $+functions[_freebsd-rustdate__help__complete_commands] )) ||
_freebsd-rustdate__help__complete_commands() {
    local commands; commands=()
    _describe -t commands 'freebsd-rustdate help complete commands' commands "$@"
}
(( $+functions[_freebsd-rustdate__help__cron_commands] )) ||
_freebsd-rustdate__help__cron_commands() {
    local commands; commands=()
    _describe -t commands 'freebsd-rustdate help cron commands' commands "$@"
}
(( $+functions[_freebsd-rustdate__help__dump-metadata_commands] )) ||
_freebsd-rustdate__help__dump-metadata_commands() {
    local commands; commands=()
    _describe -t commands 'freebsd-rustdate help dump-metadata commands' commands "$@"
}
(( $+functions[_freebsd-rustdate__help__extract_commands] )) ||
_freebsd-rustdate__help__extract_commands() {
    local commands; commands=()
    _describe -t commands 'freebsd-rustdate help extract commands' commands "$@"
}
(( $+functions[_freebsd-rustdate__help__fetch_commands] )) ||
_freebsd-rustdate__help__fetch_commands() {
    local commands; commands=()
    _describe -t commands 'freebsd-rustdate help fetch commands' commands "$@"
}
(( $+functions[_freebsd-rustdate__help__help_commands] )) ||
_freebsd-rustdate__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'freebsd-rustdate help help commands' commands "$@"
}
(( $+functions[_freebsd-rustdate__help__install_commands] )) ||
_freebsd-rustdate__help__install_commands() {
    local commands; commands=()
    _describe -t commands 'freebsd-rustdate help install commands' commands "$@"
}
(( $+functions[_freebsd-rustdate__help__resolve-merges_commands] )) ||
_freebsd-rustdate__help__resolve-merges_commands() {
    local commands; commands=()
    _describe -t commands 'freebsd-rustdate help resolve-merges commands' commands "$@"
}
(( $+functions[_freebsd-rustdate__help__show-install_commands] )) ||
_freebsd-rustdate__help__show-install_commands() {
    local commands; commands=()
    _describe -t commands 'freebsd-rustdate help show-install commands' commands "$@"
}
(( $+functions[_freebsd-rustdate__help__show-merges_commands] )) ||
_freebsd-rustdate__help__show-merges_commands() {
    local commands; commands=()
    _describe -t commands 'freebsd-rustdate help show-merges commands' commands "$@"
}
(( $+functions[_freebsd-rustdate__help__upgrade_commands] )) ||
_freebsd-rustdate__help__upgrade_commands() {
    local commands; commands=()
    _describe -t commands 'freebsd-rustdate help upgrade commands' commands "$@"
}
(( $+functions[_freebsd-rustdate__install_commands] )) ||
_freebsd-rustdate__install_commands() {
    local commands; commands=()
    _describe -t commands 'freebsd-rustdate install commands' commands "$@"
}
(( $+functions[_freebsd-rustdate__resolve-merges_commands] )) ||
_freebsd-rustdate__resolve-merges_commands() {
    local commands; commands=()
    _describe -t commands 'freebsd-rustdate resolve-merges commands' commands "$@"
}
(( $+functions[_freebsd-rustdate__show-install_commands] )) ||
_freebsd-rustdate__show-install_commands() {
    local commands; commands=()
    _describe -t commands 'freebsd-rustdate show-install commands' commands "$@"
}
(( $+functions[_freebsd-rustdate__show-merges_commands] )) ||
_freebsd-rustdate__show-merges_commands() {
    local commands; commands=()
    _describe -t commands 'freebsd-rustdate show-merges commands' commands "$@"
}
(( $+functions[_freebsd-rustdate__upgrade_commands] )) ||
_freebsd-rustdate__upgrade_commands() {
    local commands; commands=()
    _describe -t commands 'freebsd-rustdate upgrade commands' commands "$@"
}

if [ "$funcstack[1]" = "_freebsd-rustdate" ]; then
    _freebsd-rustdate "$@"
else
    compdef _freebsd-rustdate freebsd-rustdate
fi
