#compdef pk

autoload -U is-at-least

_pk() {
    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[@]}" : \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_pk_commands" \
"*::: :->pk" \
&& ret=0
    case $state in
    (pk)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:pk-command-$line[1]:"
        case $line[1] in
            (completion)
_arguments "${_arguments_options[@]}" : \
'-d+[Target directory for completion files]:DIR:_default' \
'--dir=[Target directory for completion files]:DIR:_default' \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
'::shell -- Target shell:(bash elvish fish powershell zsh)' \
&& ret=0
;;
(cpv)
_arguments "${_arguments_options[@]}" : \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
":: :_pk__cpv_commands" \
"*::: :->cpv" \
&& ret=0

    case $state in
    (cpv)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:pk-cpv-command-$line[1]:"
        case $line[1] in
            (compare)
_arguments "${_arguments_options[@]}" : \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'*::values -- Comparison expressions:_default' \
&& ret=0
;;
(intersect)
_arguments "${_arguments_options[@]}" : \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
':cpv:_default' \
':cpv_or_dep:_default' \
&& ret=0
;;
(parse)
_arguments "${_arguments_options[@]}" : \
'-f+[Output using a custom format]:FORMAT:_default' \
'--format=[Output using a custom format]:FORMAT:_default' \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
'*::values -- Values to parse:_default' \
&& ret=0
;;
(set)
_arguments "${_arguments_options[@]}" : \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
'*::values:_default' \
&& ret=0
;;
(sort)
_arguments "${_arguments_options[@]}" : \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
'*::values:_default' \
&& ret=0
;;
        esac
    ;;
esac
;;
(dep)
_arguments "${_arguments_options[@]}" : \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
":: :_pk__dep_commands" \
"*::: :->dep" \
&& ret=0

    case $state in
    (dep)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:pk-dep-command-$line[1]:"
        case $line[1] in
            (compare)
_arguments "${_arguments_options[@]}" : \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'*::values -- Comparison expressions:_default' \
&& ret=0
;;
(intersect)
_arguments "${_arguments_options[@]}" : \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
':dep:_default' \
':cpv_or_dep:_default' \
&& ret=0
;;
(parse)
_arguments "${_arguments_options[@]}" : \
'--eapi=[Use a specific EAPI]:EAPI:_default' \
'-f+[Output using a custom format]:FORMAT:_default' \
'--format=[Output using a custom format]:FORMAT:_default' \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
'*::values -- Values to parse:_default' \
&& ret=0
;;
(set)
_arguments "${_arguments_options[@]}" : \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
'*::values:_default' \
&& ret=0
;;
(sort)
_arguments "${_arguments_options[@]}" : \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
'*::values:_default' \
&& ret=0
;;
        esac
    ;;
esac
;;
(pkg)
_arguments "${_arguments_options[@]}" : \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
":: :_pk__pkg_commands" \
"*::: :->pkg" \
&& ret=0

    case $state in
    (pkg)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:pk-pkg-command-$line[1]:"
        case $line[1] in
            (env)
_arguments "${_arguments_options[@]}" : \
'*-f+[Variable filtering]:FILTER[,....]:_default' \
'*--filter=[Variable filtering]:FILTER[,....]:_default' \
'-r+[Target repo]:REPO:_default' \
'--repo=[Target repo]:REPO:_default' \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'-i[Ignore invalid packages]' \
'--ignore[Ignore invalid packages]' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
'*::targets -- Target packages or paths:_default' \
&& ret=0
;;
(fetch)
_arguments "${_arguments_options[@]}" : \
'-c+[Concurrent downloads]:CONCURRENT:_default' \
'--concurrent=[Concurrent downloads]:CONCURRENT:_default' \
'-d+[Download directory]:DIR:_default' \
'--dir=[Download directory]:DIR:_default' \
'-F+[Filter URLs via regex]:REGEX:_default' \
'--filter=[Filter URLs via regex]:REGEX:_default' \
'-t+[Connection timeout in seconds]:TIMEOUT:_default' \
'--timeout=[Connection timeout in seconds]:TIMEOUT:_default' \
'-r+[Target repo]:REPO:_default' \
'--repo=[Target repo]:REPO:_default' \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'-f[Overwrite existing files]' \
'--force[Overwrite existing files]' \
'-i[Ignore invalid packages]' \
'--ignore[Ignore invalid packages]' \
'-I[Ignore invalid service certificates]' \
'--insecure[Ignore invalid service certificates]' \
'-m[Try fetching from default mirrors]' \
'--mirrors[Try fetching from default mirrors]' \
'-n[Disable progress output]' \
'--no-progress[Disable progress output]' \
'-p[Output targets instead of fetching them]' \
'--pretend[Output targets instead of fetching them]' \
'--restrict[Process fetch-restricted URLS]' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
'*::targets -- Target packages or paths:_default' \
&& ret=0
;;
(manifest)
_arguments "${_arguments_options[@]}" : \
'-c+[Concurrent downloads]:CONCURRENT:_default' \
'--concurrent=[Concurrent downloads]:CONCURRENT:_default' \
'-d+[Download directory]:DIR:_default' \
'--dir=[Download directory]:DIR:_default' \
'-t+[Connection timeout in seconds]:TIMEOUT:_default' \
'--timeout=[Connection timeout in seconds]:TIMEOUT:_default' \
'-r+[Target repo]:REPO:_default' \
'--repo=[Target repo]:REPO:_default' \
'--thick=[Force manifest type]' \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'-f[Force remanifest]' \
'--force[Force remanifest]' \
'-i[Ignore invalid service certificates]' \
'--insecure[Ignore invalid service certificates]' \
'-m[Try fetching from default mirrors]' \
'--mirrors[Try fetching from default mirrors]' \
'-n[Disable progress output]' \
'--no-progress[Disable progress output]' \
'--stdout[Output to stdout]' \
'--restrict[Process fetch-restricted URLS]' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
'*::targets -- Target packages or paths:_default' \
&& ret=0
;;
(metadata)
_arguments "${_arguments_options[@]}" : \
'-j+[Parallel jobs to run]:JOBS:_default' \
'--jobs=[Parallel jobs to run]:JOBS:_default' \
'-p+[Custom cache path]:PATH:_default' \
'--path=[Custom cache path]:PATH:_default' \
'--format=[Custom cache format]:FORMAT:_default' \
'-r+[Target repo]:REPO:_default' \
'--repo=[Target repo]:REPO:_default' \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'-f[Force regeneration to occur]' \
'--force[Force regeneration to occur]' \
'-V[Verify metadata without updating cache]' \
'--verify[Verify metadata without updating cache]' \
'-R[Remove cache entries]' \
'--remove[Remove cache entries]' \
'-n[Disable progress bar]' \
'--no-progress[Disable progress bar]' \
'-o[Capture stderr and stdout]' \
'--output[Capture stderr and stdout]' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
'*::targets -- Target packages or paths:_default' \
&& ret=0
;;
(pretend)
_arguments "${_arguments_options[@]}" : \
'-r+[Target repo]:REPO:_default' \
'--repo=[Target repo]:REPO:_default' \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'-i[Ignore invalid packages]' \
'--ignore[Ignore invalid packages]' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
'*::targets -- Target packages or paths:_default' \
&& ret=0
;;
(revdeps)
_arguments "${_arguments_options[@]}" : \
'-r+[Target repository]:REPO:_default' \
'--repo=[Target repository]:REPO:_default' \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'-i[Ignore invalid packages]' \
'--ignore[Ignore invalid packages]' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
'*::targets -- Target dependencies:_default' \
&& ret=0
;;
(showkw)
_arguments "${_arguments_options[@]}" : \
'-r+[Target repo]:REPO:_default' \
'--repo=[Target repo]:REPO:_default' \
'*-a+[Target arches]:TARGET[,...]:_default' \
'*--arches=[Target arches]:TARGET[,...]:_default' \
'-f+[Set the tabular format]:FORMAT:(ascii modern)' \
'--format=[Set the tabular format]:FORMAT:(ascii modern)' \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'-i[Ignore invalid packages]' \
'--ignore[Ignore invalid packages]' \
'-p[Show prefix arches]' \
'--prefix[Show prefix arches]' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
'*::targets -- Target packages or paths:_default' \
&& ret=0
;;
(source)
_arguments "${_arguments_options[@]}" : \
'-j+[Parallel jobs to run]:JOBS:_default' \
'--jobs=[Parallel jobs to run]:JOBS:_default' \
'(-c --cumulative)-b+[Benchmark for a duration or number of runs]' \
'(-c --cumulative)--bench=[Benchmark for a duration or number of runs]' \
'(-c --cumulative)*-B+[Apply bounds to elapsed time]:BOUND:_default' \
'(-c --cumulative)*--bound=[Apply bounds to elapsed time]:BOUND:_default' \
'-c+[Benchmark across all targets cumulatively]' \
'--cumulative=[Benchmark across all targets cumulatively]' \
'-f+[]:FORMAT:((plain\:"Plain output"
csv\:"CSV output"))' \
'--format=[]:FORMAT:((plain\:"Plain output"
csv\:"CSV output"))' \
'-r+[Target repo]:REPO:_default' \
'--repo=[Target repo]:REPO:_default' \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'(-c --cumulative)--sort[Sort output in ascending order for elapsed time]' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'*::targets -- Target packages or paths:_default' \
&& ret=0
;;
        esac
    ;;
esac
;;
(repo)
_arguments "${_arguments_options[@]}" : \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
":: :_pk__repo_commands" \
"*::: :->repo" \
&& ret=0

    case $state in
    (repo)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:pk-repo-command-$line[1]:"
        case $line[1] in
            (add)
_arguments "${_arguments_options[@]}" : \
'-n+[Repository name]:NAME:_default' \
'--name=[Repository name]:NAME:_default' \
'-p+[Repository priority]:PRIORITY:_default' \
'--priority=[Repository priority]:PRIORITY:_default' \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'-f[Only create the config file]' \
'--file[Only create the config file]' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
'*::uris -- Repository URIs:_default' \
&& ret=0
;;
(eapi)
_arguments "${_arguments_options[@]}" : \
'--eapi=[Output packages for a target EAPI]:EAPI:_default' \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'-i[Ignore invalid packages]' \
'--ignore[Ignore invalid packages]' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
'*::repos -- Target repositories:_default' \
&& ret=0
;;
(eclass)
_arguments "${_arguments_options[@]}" : \
'--eclass=[Output packages for a target eclass]:ECLASS:_default' \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'-i[Ignore invalid packages]' \
'--ignore[Ignore invalid packages]' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
'*::repos -- Target repositories:_default' \
&& ret=0
;;
(leaf)
_arguments "${_arguments_options[@]}" : \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'-i[Ignore invalid packages]' \
'--ignore[Ignore invalid packages]' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
'::repo -- Target repository:_default' \
&& ret=0
;;
(license)
_arguments "${_arguments_options[@]}" : \
'*--licenses=[Output packages for target licenses]:LICENSE:_default' \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'-i[Ignore invalid packages]' \
'--ignore[Ignore invalid packages]' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
'*::repos -- Target repositories:_default' \
&& ret=0
;;
(list)
_arguments "${_arguments_options[@]}" : \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'-f[Output full repository info]' \
'--full[Output full repository info]' \
'(-f --full)-p[Output repository paths]' \
'(-f --full)--path[Output repository paths]' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(metadata)
_arguments "${_arguments_options[@]}" : \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
":: :_pk__repo__metadata_commands" \
"*::: :->metadata" \
&& ret=0

    case $state in
    (metadata)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:pk-repo-metadata-command-$line[1]:"
        case $line[1] in
            (clean)
_arguments "${_arguments_options[@]}" : \
'-p+[Custom cache path]:PATH:_default' \
'--path=[Custom cache path]:PATH:_default' \
'--format=[Custom cache format]:FORMAT:_default' \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
'::repo -- Target repository:_default' \
&& ret=0
;;
(regen)
_arguments "${_arguments_options[@]}" : \
'-j+[Parallel jobs to run]:JOBS:_default' \
'--jobs=[Parallel jobs to run]:JOBS:_default' \
'-p+[Custom cache path]:PATH:_default' \
'--path=[Custom cache path]:PATH:_default' \
'--format=[Custom cache format]:FORMAT:_default' \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'-f[Force regeneration to occur]' \
'--force[Force regeneration to occur]' \
'-n[Disable progress bar]' \
'--no-progress[Disable progress bar]' \
'-o[Capture stderr and stdout]' \
'--output[Capture stderr and stdout]' \
'--use-local[Update local USE cache]' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
'::repo -- Target repository:_default' \
&& ret=0
;;
(remove)
_arguments "${_arguments_options[@]}" : \
'-p+[Custom cache path]:PATH:_default' \
'--path=[Custom cache path]:PATH:_default' \
'--format=[Custom cache format]:FORMAT:_default' \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
'::repo -- Target repository:_default' \
&& ret=0
;;
        esac
    ;;
esac
;;
(mirror)
_arguments "${_arguments_options[@]}" : \
'--mirror=[Output packages for a target mirror]:MIRROR:_default' \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'-i[Ignore invalid packages]' \
'--ignore[Ignore invalid packages]' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
'*::repos -- Target repositories:_default' \
&& ret=0
;;
(remove)
_arguments "${_arguments_options[@]}" : \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
'*::repos -- Repository name:_default' \
&& ret=0
;;
(revdeps)
_arguments "${_arguments_options[@]}" : \
'-d+[Target directory]:DIR:_default' \
'--dir=[Target directory]:DIR:_default' \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'-i[Ignore invalid packages]' \
'--ignore[Ignore invalid packages]' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
'::repo -- Target repository:_default' \
&& ret=0
;;
(sync)
_arguments "${_arguments_options[@]}" : \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
'*::repos -- Repository name:_default' \
&& ret=0
;;
        esac
    ;;
esac
;;
(version)
_arguments "${_arguments_options[@]}" : \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
":: :_pk__version_commands" \
"*::: :->version" \
&& ret=0

    case $state in
    (version)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:pk-version-command-$line[1]:"
        case $line[1] in
            (compare)
_arguments "${_arguments_options[@]}" : \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'*::values -- Comparison expressions:_default' \
&& ret=0
;;
(intersect)
_arguments "${_arguments_options[@]}" : \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
':ver1:_default' \
':ver2:_default' \
&& ret=0
;;
(parse)
_arguments "${_arguments_options[@]}" : \
'-f+[Output using a custom format]:FORMAT:_default' \
'--format=[Output using a custom format]:FORMAT:_default' \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
'*::values -- Values to parse:_default' \
&& ret=0
;;
(set)
_arguments "${_arguments_options[@]}" : \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
'*::values:_default' \
&& ret=0
;;
(sort)
_arguments "${_arguments_options[@]}" : \
'--color=[Enable/disable color support]:BOOL:(true false)' \
'--config=[Use a custom config]:PATH:_default' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'(--config)--portage[Load repos from portage]' \
'-h[Print help]' \
'--help[Print help]' \
'*::values:_default' \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
}

(( $+functions[_pk_commands] )) ||
_pk_commands() {
    local commands; commands=(
'completion:Generate shell completion' \
'cpv:Cpv commands' \
'dep:Dependency commands' \
'pkg:Package commands' \
'repo:Repository commands' \
'version:Version commands' \
    )
    _describe -t commands 'pk commands' commands "$@"
}
(( $+functions[_pk__completion_commands] )) ||
_pk__completion_commands() {
    local commands; commands=()
    _describe -t commands 'pk completion commands' commands "$@"
}
(( $+functions[_pk__cpv_commands] )) ||
_pk__cpv_commands() {
    local commands; commands=(
'compare:Compare two cpvs' \
'intersect:Determine if a cpv intersects another value' \
'parse:Parse cpv and optionally print formatted output' \
'set:Collapse cpvs into a set' \
'sort:Sort cpvs' \
    )
    _describe -t commands 'pk cpv commands' commands "$@"
}
(( $+functions[_pk__cpv__compare_commands] )) ||
_pk__cpv__compare_commands() {
    local commands; commands=()
    _describe -t commands 'pk cpv compare commands' commands "$@"
}
(( $+functions[_pk__cpv__intersect_commands] )) ||
_pk__cpv__intersect_commands() {
    local commands; commands=()
    _describe -t commands 'pk cpv intersect commands' commands "$@"
}
(( $+functions[_pk__cpv__parse_commands] )) ||
_pk__cpv__parse_commands() {
    local commands; commands=()
    _describe -t commands 'pk cpv parse commands' commands "$@"
}
(( $+functions[_pk__cpv__set_commands] )) ||
_pk__cpv__set_commands() {
    local commands; commands=()
    _describe -t commands 'pk cpv set commands' commands "$@"
}
(( $+functions[_pk__cpv__sort_commands] )) ||
_pk__cpv__sort_commands() {
    local commands; commands=()
    _describe -t commands 'pk cpv sort commands' commands "$@"
}
(( $+functions[_pk__dep_commands] )) ||
_pk__dep_commands() {
    local commands; commands=(
'compare:Compare two deps' \
'intersect:Determine if a dep intersects another value' \
'parse:Parse a dep and optionally print formatted output' \
'set:Collapse deps into a set' \
'sort:Sort deps' \
    )
    _describe -t commands 'pk dep commands' commands "$@"
}
(( $+functions[_pk__dep__compare_commands] )) ||
_pk__dep__compare_commands() {
    local commands; commands=()
    _describe -t commands 'pk dep compare commands' commands "$@"
}
(( $+functions[_pk__dep__intersect_commands] )) ||
_pk__dep__intersect_commands() {
    local commands; commands=()
    _describe -t commands 'pk dep intersect commands' commands "$@"
}
(( $+functions[_pk__dep__parse_commands] )) ||
_pk__dep__parse_commands() {
    local commands; commands=()
    _describe -t commands 'pk dep parse commands' commands "$@"
}
(( $+functions[_pk__dep__set_commands] )) ||
_pk__dep__set_commands() {
    local commands; commands=()
    _describe -t commands 'pk dep set commands' commands "$@"
}
(( $+functions[_pk__dep__sort_commands] )) ||
_pk__dep__sort_commands() {
    local commands; commands=()
    _describe -t commands 'pk dep sort commands' commands "$@"
}
(( $+functions[_pk__pkg_commands] )) ||
_pk__pkg_commands() {
    local commands; commands=(
'env:Output ebuild environment' \
'fetch:Fetch distfiles' \
'manifest:Update manifests' \
'metadata:Manipulate package metadata' \
'pretend:Run the pkg_pretend phase' \
'revdeps:Output reverse dependencies' \
'showkw:Output package keywords' \
'source:Benchmark ebuild sourcing' \
    )
    _describe -t commands 'pk pkg commands' commands "$@"
}
(( $+functions[_pk__pkg__env_commands] )) ||
_pk__pkg__env_commands() {
    local commands; commands=()
    _describe -t commands 'pk pkg env commands' commands "$@"
}
(( $+functions[_pk__pkg__fetch_commands] )) ||
_pk__pkg__fetch_commands() {
    local commands; commands=()
    _describe -t commands 'pk pkg fetch commands' commands "$@"
}
(( $+functions[_pk__pkg__manifest_commands] )) ||
_pk__pkg__manifest_commands() {
    local commands; commands=()
    _describe -t commands 'pk pkg manifest commands' commands "$@"
}
(( $+functions[_pk__pkg__metadata_commands] )) ||
_pk__pkg__metadata_commands() {
    local commands; commands=()
    _describe -t commands 'pk pkg metadata commands' commands "$@"
}
(( $+functions[_pk__pkg__pretend_commands] )) ||
_pk__pkg__pretend_commands() {
    local commands; commands=()
    _describe -t commands 'pk pkg pretend commands' commands "$@"
}
(( $+functions[_pk__pkg__revdeps_commands] )) ||
_pk__pkg__revdeps_commands() {
    local commands; commands=()
    _describe -t commands 'pk pkg revdeps commands' commands "$@"
}
(( $+functions[_pk__pkg__showkw_commands] )) ||
_pk__pkg__showkw_commands() {
    local commands; commands=()
    _describe -t commands 'pk pkg showkw commands' commands "$@"
}
(( $+functions[_pk__pkg__source_commands] )) ||
_pk__pkg__source_commands() {
    local commands; commands=()
    _describe -t commands 'pk pkg source commands' commands "$@"
}
(( $+functions[_pk__repo_commands] )) ||
_pk__repo_commands() {
    local commands; commands=(
'add:Add repository to config' \
'eapi:Output EAPI statistics' \
'eclass:Output eclass statistics' \
'leaf:Output leaf packages' \
'license:Output license statistics' \
'list:List repositories' \
'metadata:Manipulate repo metadata' \
'mirror:Output mirror statistics' \
'remove:Remove repositories' \
'revdeps:Output revdeps cache' \
'sync:Sync repos' \
    )
    _describe -t commands 'pk repo commands' commands "$@"
}
(( $+functions[_pk__repo__add_commands] )) ||
_pk__repo__add_commands() {
    local commands; commands=()
    _describe -t commands 'pk repo add commands' commands "$@"
}
(( $+functions[_pk__repo__eapi_commands] )) ||
_pk__repo__eapi_commands() {
    local commands; commands=()
    _describe -t commands 'pk repo eapi commands' commands "$@"
}
(( $+functions[_pk__repo__eclass_commands] )) ||
_pk__repo__eclass_commands() {
    local commands; commands=()
    _describe -t commands 'pk repo eclass commands' commands "$@"
}
(( $+functions[_pk__repo__leaf_commands] )) ||
_pk__repo__leaf_commands() {
    local commands; commands=()
    _describe -t commands 'pk repo leaf commands' commands "$@"
}
(( $+functions[_pk__repo__license_commands] )) ||
_pk__repo__license_commands() {
    local commands; commands=()
    _describe -t commands 'pk repo license commands' commands "$@"
}
(( $+functions[_pk__repo__list_commands] )) ||
_pk__repo__list_commands() {
    local commands; commands=()
    _describe -t commands 'pk repo list commands' commands "$@"
}
(( $+functions[_pk__repo__metadata_commands] )) ||
_pk__repo__metadata_commands() {
    local commands; commands=(
'clean:Clean metadata cache' \
'regen:Regenerate metadata cache' \
'remove:Remove metadata cache' \
    )
    _describe -t commands 'pk repo metadata commands' commands "$@"
}
(( $+functions[_pk__repo__metadata__clean_commands] )) ||
_pk__repo__metadata__clean_commands() {
    local commands; commands=()
    _describe -t commands 'pk repo metadata clean commands' commands "$@"
}
(( $+functions[_pk__repo__metadata__regen_commands] )) ||
_pk__repo__metadata__regen_commands() {
    local commands; commands=()
    _describe -t commands 'pk repo metadata regen commands' commands "$@"
}
(( $+functions[_pk__repo__metadata__remove_commands] )) ||
_pk__repo__metadata__remove_commands() {
    local commands; commands=()
    _describe -t commands 'pk repo metadata remove commands' commands "$@"
}
(( $+functions[_pk__repo__mirror_commands] )) ||
_pk__repo__mirror_commands() {
    local commands; commands=()
    _describe -t commands 'pk repo mirror commands' commands "$@"
}
(( $+functions[_pk__repo__remove_commands] )) ||
_pk__repo__remove_commands() {
    local commands; commands=()
    _describe -t commands 'pk repo remove commands' commands "$@"
}
(( $+functions[_pk__repo__revdeps_commands] )) ||
_pk__repo__revdeps_commands() {
    local commands; commands=()
    _describe -t commands 'pk repo revdeps commands' commands "$@"
}
(( $+functions[_pk__repo__sync_commands] )) ||
_pk__repo__sync_commands() {
    local commands; commands=()
    _describe -t commands 'pk repo sync commands' commands "$@"
}
(( $+functions[_pk__version_commands] )) ||
_pk__version_commands() {
    local commands; commands=(
'compare:Compare two versions' \
'intersect:Determine if two versions intersect' \
'parse:Parse a version and optionally print formatted output' \
'set:Collapse versions into a set' \
'sort:Sort versions' \
    )
    _describe -t commands 'pk version commands' commands "$@"
}
(( $+functions[_pk__version__compare_commands] )) ||
_pk__version__compare_commands() {
    local commands; commands=()
    _describe -t commands 'pk version compare commands' commands "$@"
}
(( $+functions[_pk__version__intersect_commands] )) ||
_pk__version__intersect_commands() {
    local commands; commands=()
    _describe -t commands 'pk version intersect commands' commands "$@"
}
(( $+functions[_pk__version__parse_commands] )) ||
_pk__version__parse_commands() {
    local commands; commands=()
    _describe -t commands 'pk version parse commands' commands "$@"
}
(( $+functions[_pk__version__set_commands] )) ||
_pk__version__set_commands() {
    local commands; commands=()
    _describe -t commands 'pk version set commands' commands "$@"
}
(( $+functions[_pk__version__sort_commands] )) ||
_pk__version__sort_commands() {
    local commands; commands=()
    _describe -t commands 'pk version sort commands' commands "$@"
}

if [ "$funcstack[1]" = "_pk" ]; then
    _pk "$@"
else
    compdef _pk pk
fi
