#compdef jj-gh

autoload -U is-at-least

_jj-gh() {
    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[@]}" : \
'--log-level=[Set log level explicitly, overrides \`-v\` and \`-q\`]:LEVEL:_default' \
'--remote=[Git remote used for the user'\''s own pushes and PR head lookups. Precedence\: this flag, then git'\''s auto-detected default push remote, then \`default_remote\` in config]:NAME:_default' \
'--upstream-remote=[Git remote used as the PR target in fork workflows. Precedence\: this flag, then \`upstream_remote\` in config, else \[\`crate\:\:gh\:\:remote\:\:DEFAULT_UPSTREAM_REMOTE\`\]]:NAME:_default' \
'--gh-askpass=[Askpass helper command that prints a GitHub token on stdout; e.g. \`--gh-askpass "op read op\://Vault/gh/token"\`. Highest-priority token source; outranks \`\$GH_ASKPASS\`, the token env vars, and \`gh_askpass\` in config]:CMD:_default' \
'--askpass-timeout=[Timeout in seconds for the askpass helper. Default\: 20]:SECS:_default' \
'*-v[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'*--verbose[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'(-v --verbose)-q[Drop log level to \`ERROR\`]' \
'(-v --verbose)--quiet[Drop log level to \`ERROR\`]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_jj-gh_commands" \
"*::: :->jj-gh" \
&& ret=0
    case $state in
    (jj-gh)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:jj-gh-command-$line[1]:"
        case $line[1] in
            (pr)
_arguments "${_arguments_options[@]}" : \
'--log-level=[Set log level explicitly, overrides \`-v\` and \`-q\`]:LEVEL:_default' \
'--remote=[Git remote used for the user'\''s own pushes and PR head lookups. Precedence\: this flag, then git'\''s auto-detected default push remote, then \`default_remote\` in config]:NAME:_default' \
'--upstream-remote=[Git remote used as the PR target in fork workflows. Precedence\: this flag, then \`upstream_remote\` in config, else \[\`crate\:\:gh\:\:remote\:\:DEFAULT_UPSTREAM_REMOTE\`\]]:NAME:_default' \
'--gh-askpass=[Askpass helper command that prints a GitHub token on stdout; e.g. \`--gh-askpass "op read op\://Vault/gh/token"\`. Highest-priority token source; outranks \`\$GH_ASKPASS\`, the token env vars, and \`gh_askpass\` in config]:CMD:_default' \
'--askpass-timeout=[Timeout in seconds for the askpass helper. Default\: 20]:SECS:_default' \
'*-v[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'*--verbose[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'(-v --verbose)-q[Drop log level to \`ERROR\`]' \
'(-v --verbose)--quiet[Drop log level to \`ERROR\`]' \
'-h[Print help]' \
'--help[Print help]' \
":: :_jj-gh__subcmd__pr_commands" \
"*::: :->pr" \
&& ret=0

    case $state in
    (pr)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:jj-gh-pr-command-$line[1]:"
        case $line[1] in
            (auto-merge)
_arguments "${_arguments_options[@]}" : \
'-m+[Merge method used when enabling auto-merge. Overrides config \`auto_merge_method\` (default \`merge\`)]:METHOD:(merge squash rebase)' \
'--method=[Merge method used when enabling auto-merge. Overrides config \`auto_merge_method\` (default \`merge\`)]:METHOD:(merge squash rebase)' \
'--log-level=[Set log level explicitly, overrides \`-v\` and \`-q\`]:LEVEL:_default' \
'--remote=[Git remote used for the user'\''s own pushes and PR head lookups. Precedence\: this flag, then git'\''s auto-detected default push remote, then \`default_remote\` in config]:NAME:_default' \
'--upstream-remote=[Git remote used as the PR target in fork workflows. Precedence\: this flag, then \`upstream_remote\` in config, else \[\`crate\:\:gh\:\:remote\:\:DEFAULT_UPSTREAM_REMOTE\`\]]:NAME:_default' \
'--gh-askpass=[Askpass helper command that prints a GitHub token on stdout; e.g. \`--gh-askpass "op read op\://Vault/gh/token"\`. Highest-priority token source; outranks \`\$GH_ASKPASS\`, the token env vars, and \`gh_askpass\` in config]:CMD:_default' \
'--askpass-timeout=[Timeout in seconds for the askpass helper. Default\: 20]:SECS:_default' \
'*-v[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'*--verbose[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'(-v --verbose)-q[Drop log level to \`ERROR\`]' \
'(-v --verbose)--quiet[Drop log level to \`ERROR\`]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':number_or_rev -- PR number, or revision ID to look up a PR from:_default' \
&& ret=0
;;
(am)
_arguments "${_arguments_options[@]}" : \
'-m+[Merge method used when enabling auto-merge. Overrides config \`auto_merge_method\` (default \`merge\`)]:METHOD:(merge squash rebase)' \
'--method=[Merge method used when enabling auto-merge. Overrides config \`auto_merge_method\` (default \`merge\`)]:METHOD:(merge squash rebase)' \
'--log-level=[Set log level explicitly, overrides \`-v\` and \`-q\`]:LEVEL:_default' \
'--remote=[Git remote used for the user'\''s own pushes and PR head lookups. Precedence\: this flag, then git'\''s auto-detected default push remote, then \`default_remote\` in config]:NAME:_default' \
'--upstream-remote=[Git remote used as the PR target in fork workflows. Precedence\: this flag, then \`upstream_remote\` in config, else \[\`crate\:\:gh\:\:remote\:\:DEFAULT_UPSTREAM_REMOTE\`\]]:NAME:_default' \
'--gh-askpass=[Askpass helper command that prints a GitHub token on stdout; e.g. \`--gh-askpass "op read op\://Vault/gh/token"\`. Highest-priority token source; outranks \`\$GH_ASKPASS\`, the token env vars, and \`gh_askpass\` in config]:CMD:_default' \
'--askpass-timeout=[Timeout in seconds for the askpass helper. Default\: 20]:SECS:_default' \
'*-v[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'*--verbose[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'(-v --verbose)-q[Drop log level to \`ERROR\`]' \
'(-v --verbose)--quiet[Drop log level to \`ERROR\`]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':number_or_rev -- PR number, or revision ID to look up a PR from:_default' \
&& ret=0
;;
(create)
_arguments "${_arguments_options[@]}" : \
'--base=[Override the base bookmark. Default\: closest ancestor bookmark on the stack, falling back to jj \`trunk()\`, then to the configured \`default_base_branch\`. Errors if none resolve]:BRANCH:_default' \
'--auto-merge-method=[Merge method used when auto-merge is enabled. Overrides config \`auto_merge_method\` (default \`merge\`)]:METHOD:(merge squash rebase)' \
'(--template-file --no-template)-T+[jj template string used to render the PR body. Evaluated against the revset being PR'\''d in chronological order (\`--reversed\`), so a multi-commit stack renders bottom-up]:TEMPLATE:_default' \
'(--template-file --no-template)--template=[jj template string used to render the PR body. Evaluated against the revset being PR'\''d in chronological order (\`--reversed\`), so a multi-commit stack renders bottom-up]:TEMPLATE:_default' \
'(-T --template --no-template)--template-file=[Path or name (under \`.github/PULL_REQUEST_TEMPLATE/\`) of a markdown template file to use as the PR body. Mutually exclusive with \`-T\` and \`--no-template\`]:PATH_OR_NAME:_default' \
'--title-template=[jj template string used to render candidate PR titles. Evaluated once per commit in the PR revset]:TEMPLATE:_default' \
'-e+[Editor command, e.g. \`--editor "nvim +7"\`. Precedence\: this flag, then \`editor\` in config, then \`\$VISUAL\`, then \`\$EDITOR\`]:CMD:_default' \
'--editor=[Editor command, e.g. \`--editor "nvim +7"\`. Precedence\: this flag, then \`editor\` in config, then \`\$VISUAL\`, then \`\$EDITOR\`]:CMD:_default' \
'--log-level=[Set log level explicitly, overrides \`-v\` and \`-q\`]:LEVEL:_default' \
'--remote=[Git remote used for the user'\''s own pushes and PR head lookups. Precedence\: this flag, then git'\''s auto-detected default push remote, then \`default_remote\` in config]:NAME:_default' \
'--upstream-remote=[Git remote used as the PR target in fork workflows. Precedence\: this flag, then \`upstream_remote\` in config, else \[\`crate\:\:gh\:\:remote\:\:DEFAULT_UPSTREAM_REMOTE\`\]]:NAME:_default' \
'--gh-askpass=[Askpass helper command that prints a GitHub token on stdout; e.g. \`--gh-askpass "op read op\://Vault/gh/token"\`. Highest-priority token source; outranks \`\$GH_ASKPASS\`, the token env vars, and \`gh_askpass\` in config]:CMD:_default' \
'--askpass-timeout=[Timeout in seconds for the askpass helper. Default\: 20]:SECS:_default' \
'--draft[Force the PR to be a draft. Overrides config (default\: \`draft = false\`). Use \`--no-draft\` to force non-draft]' \
'(--draft)--no-draft[Force the PR to be non-draft. Overrides config]' \
'--auto-merge[Enable auto-merge on the PR after creation (merges once required checks pass). Overrides config (default\: \`auto_merge = false\`). Use \`--no-auto-merge\` to force no auto-merge]' \
'(--auto-merge)--no-auto-merge[Disable auto-merge on the created PR. Overrides config]' \
'(-T --template --template-file)--no-template[Skip body templating entirely]' \
'--pick-title[Interactively choose which commit supplies the PR title]' \
'--no-edit[Create the PR without opening an editor. Useful when combined with \`--draft\`]' \
'--diffs[Show a preview of the PR diffs while creating the PR body. Overrides \`pr_create_show_diffs\` configuration. Use \`--no-diffs\` to disable]' \
'(--diffs)--no-diffs[Hide the PR diff preview while creating the PR body. Overrides config]' \
'*-v[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'*--verbose[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'(-v --verbose)-q[Drop log level to \`ERROR\`]' \
'(-v --verbose)--quiet[Drop log level to \`ERROR\`]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':rev -- Revision to create the PR from:_default' \
&& ret=0
;;
(c)
_arguments "${_arguments_options[@]}" : \
'--base=[Override the base bookmark. Default\: closest ancestor bookmark on the stack, falling back to jj \`trunk()\`, then to the configured \`default_base_branch\`. Errors if none resolve]:BRANCH:_default' \
'--auto-merge-method=[Merge method used when auto-merge is enabled. Overrides config \`auto_merge_method\` (default \`merge\`)]:METHOD:(merge squash rebase)' \
'(--template-file --no-template)-T+[jj template string used to render the PR body. Evaluated against the revset being PR'\''d in chronological order (\`--reversed\`), so a multi-commit stack renders bottom-up]:TEMPLATE:_default' \
'(--template-file --no-template)--template=[jj template string used to render the PR body. Evaluated against the revset being PR'\''d in chronological order (\`--reversed\`), so a multi-commit stack renders bottom-up]:TEMPLATE:_default' \
'(-T --template --no-template)--template-file=[Path or name (under \`.github/PULL_REQUEST_TEMPLATE/\`) of a markdown template file to use as the PR body. Mutually exclusive with \`-T\` and \`--no-template\`]:PATH_OR_NAME:_default' \
'--title-template=[jj template string used to render candidate PR titles. Evaluated once per commit in the PR revset]:TEMPLATE:_default' \
'-e+[Editor command, e.g. \`--editor "nvim +7"\`. Precedence\: this flag, then \`editor\` in config, then \`\$VISUAL\`, then \`\$EDITOR\`]:CMD:_default' \
'--editor=[Editor command, e.g. \`--editor "nvim +7"\`. Precedence\: this flag, then \`editor\` in config, then \`\$VISUAL\`, then \`\$EDITOR\`]:CMD:_default' \
'--log-level=[Set log level explicitly, overrides \`-v\` and \`-q\`]:LEVEL:_default' \
'--remote=[Git remote used for the user'\''s own pushes and PR head lookups. Precedence\: this flag, then git'\''s auto-detected default push remote, then \`default_remote\` in config]:NAME:_default' \
'--upstream-remote=[Git remote used as the PR target in fork workflows. Precedence\: this flag, then \`upstream_remote\` in config, else \[\`crate\:\:gh\:\:remote\:\:DEFAULT_UPSTREAM_REMOTE\`\]]:NAME:_default' \
'--gh-askpass=[Askpass helper command that prints a GitHub token on stdout; e.g. \`--gh-askpass "op read op\://Vault/gh/token"\`. Highest-priority token source; outranks \`\$GH_ASKPASS\`, the token env vars, and \`gh_askpass\` in config]:CMD:_default' \
'--askpass-timeout=[Timeout in seconds for the askpass helper. Default\: 20]:SECS:_default' \
'--draft[Force the PR to be a draft. Overrides config (default\: \`draft = false\`). Use \`--no-draft\` to force non-draft]' \
'(--draft)--no-draft[Force the PR to be non-draft. Overrides config]' \
'--auto-merge[Enable auto-merge on the PR after creation (merges once required checks pass). Overrides config (default\: \`auto_merge = false\`). Use \`--no-auto-merge\` to force no auto-merge]' \
'(--auto-merge)--no-auto-merge[Disable auto-merge on the created PR. Overrides config]' \
'(-T --template --template-file)--no-template[Skip body templating entirely]' \
'--pick-title[Interactively choose which commit supplies the PR title]' \
'--no-edit[Create the PR without opening an editor. Useful when combined with \`--draft\`]' \
'--diffs[Show a preview of the PR diffs while creating the PR body. Overrides \`pr_create_show_diffs\` configuration. Use \`--no-diffs\` to disable]' \
'(--diffs)--no-diffs[Hide the PR diff preview while creating the PR body. Overrides config]' \
'*-v[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'*--verbose[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'(-v --verbose)-q[Drop log level to \`ERROR\`]' \
'(-v --verbose)--quiet[Drop log level to \`ERROR\`]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':rev -- Revision to create the PR from:_default' \
&& ret=0
;;
(edit)
_arguments "${_arguments_options[@]}" : \
'-e+[Editor command, e.g. \`--editor "nvim +7"\`. Precedence\: this flag, then \`editor\` in config, then \`\$VISUAL\`, then \`\$EDITOR\`]:CMD:_default' \
'--editor=[Editor command, e.g. \`--editor "nvim +7"\`. Precedence\: this flag, then \`editor\` in config, then \`\$VISUAL\`, then \`\$EDITOR\`]:CMD:_default' \
'--log-level=[Set log level explicitly, overrides \`-v\` and \`-q\`]:LEVEL:_default' \
'--remote=[Git remote used for the user'\''s own pushes and PR head lookups. Precedence\: this flag, then git'\''s auto-detected default push remote, then \`default_remote\` in config]:NAME:_default' \
'--upstream-remote=[Git remote used as the PR target in fork workflows. Precedence\: this flag, then \`upstream_remote\` in config, else \[\`crate\:\:gh\:\:remote\:\:DEFAULT_UPSTREAM_REMOTE\`\]]:NAME:_default' \
'--gh-askpass=[Askpass helper command that prints a GitHub token on stdout; e.g. \`--gh-askpass "op read op\://Vault/gh/token"\`. Highest-priority token source; outranks \`\$GH_ASKPASS\`, the token env vars, and \`gh_askpass\` in config]:CMD:_default' \
'--askpass-timeout=[Timeout in seconds for the askpass helper. Default\: 20]:SECS:_default' \
'-f[Edit even if the PR body is empty. By default, \`jj-gh\` refuses to edit an empty body to avoid clobbering one that exists but failed to load]' \
'--force[Edit even if the PR body is empty. By default, \`jj-gh\` refuses to edit an empty body to avoid clobbering one that exists but failed to load]' \
'--diffs[Show a preview of the PR diffs while editing the PR. Overrides \`pr_edit_show_diffs\` configuration. Use \`--no-diffs\` to disable]' \
'(--diffs)--no-diffs[Hide the PR diff preview while editing the PR. Overrides config]' \
'*-v[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'*--verbose[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'(-v --verbose)-q[Drop log level to \`ERROR\`]' \
'(-v --verbose)--quiet[Drop log level to \`ERROR\`]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':number_or_rev -- PR number, or revision ID to look up a PR from:_default' \
&& ret=0
;;
(e)
_arguments "${_arguments_options[@]}" : \
'-e+[Editor command, e.g. \`--editor "nvim +7"\`. Precedence\: this flag, then \`editor\` in config, then \`\$VISUAL\`, then \`\$EDITOR\`]:CMD:_default' \
'--editor=[Editor command, e.g. \`--editor "nvim +7"\`. Precedence\: this flag, then \`editor\` in config, then \`\$VISUAL\`, then \`\$EDITOR\`]:CMD:_default' \
'--log-level=[Set log level explicitly, overrides \`-v\` and \`-q\`]:LEVEL:_default' \
'--remote=[Git remote used for the user'\''s own pushes and PR head lookups. Precedence\: this flag, then git'\''s auto-detected default push remote, then \`default_remote\` in config]:NAME:_default' \
'--upstream-remote=[Git remote used as the PR target in fork workflows. Precedence\: this flag, then \`upstream_remote\` in config, else \[\`crate\:\:gh\:\:remote\:\:DEFAULT_UPSTREAM_REMOTE\`\]]:NAME:_default' \
'--gh-askpass=[Askpass helper command that prints a GitHub token on stdout; e.g. \`--gh-askpass "op read op\://Vault/gh/token"\`. Highest-priority token source; outranks \`\$GH_ASKPASS\`, the token env vars, and \`gh_askpass\` in config]:CMD:_default' \
'--askpass-timeout=[Timeout in seconds for the askpass helper. Default\: 20]:SECS:_default' \
'-f[Edit even if the PR body is empty. By default, \`jj-gh\` refuses to edit an empty body to avoid clobbering one that exists but failed to load]' \
'--force[Edit even if the PR body is empty. By default, \`jj-gh\` refuses to edit an empty body to avoid clobbering one that exists but failed to load]' \
'--diffs[Show a preview of the PR diffs while editing the PR. Overrides \`pr_edit_show_diffs\` configuration. Use \`--no-diffs\` to disable]' \
'(--diffs)--no-diffs[Hide the PR diff preview while editing the PR. Overrides config]' \
'*-v[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'*--verbose[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'(-v --verbose)-q[Drop log level to \`ERROR\`]' \
'(-v --verbose)--quiet[Drop log level to \`ERROR\`]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':number_or_rev -- PR number, or revision ID to look up a PR from:_default' \
&& ret=0
;;
(fetch)
_arguments "${_arguments_options[@]}" : \
'-T+[Override the bookmark template. The argument is a jj template string evaluated once against \`root()\` (no commit context). Default\: \`pr_fetch_bookmark_template\` in config, else \`"pr-" ++ pr_number ++ "/" ++ pr_branch"\`]:TEMPLATE:_default' \
'--template=[Override the bookmark template. The argument is a jj template string evaluated once against \`root()\` (no commit context). Default\: \`pr_fetch_bookmark_template\` in config, else \`"pr-" ++ pr_number ++ "/" ++ pr_branch"\`]:TEMPLATE:_default' \
'--log-level=[Set log level explicitly, overrides \`-v\` and \`-q\`]:LEVEL:_default' \
'--remote=[Git remote used for the user'\''s own pushes and PR head lookups. Precedence\: this flag, then git'\''s auto-detected default push remote, then \`default_remote\` in config]:NAME:_default' \
'--upstream-remote=[Git remote used as the PR target in fork workflows. Precedence\: this flag, then \`upstream_remote\` in config, else \[\`crate\:\:gh\:\:remote\:\:DEFAULT_UPSTREAM_REMOTE\`\]]:NAME:_default' \
'--gh-askpass=[Askpass helper command that prints a GitHub token on stdout; e.g. \`--gh-askpass "op read op\://Vault/gh/token"\`. Highest-priority token source; outranks \`\$GH_ASKPASS\`, the token env vars, and \`gh_askpass\` in config]:CMD:_default' \
'--askpass-timeout=[Timeout in seconds for the askpass helper. Default\: 20]:SECS:_default' \
'-f[Replace an existing local bookmark of the same name]' \
'--force[Replace an existing local bookmark of the same name]' \
'*-v[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'*--verbose[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'(-v --verbose)-q[Drop log level to \`ERROR\`]' \
'(-v --verbose)--quiet[Drop log level to \`ERROR\`]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':pr -- PR number to fetch:_default' \
&& ret=0
;;
(f)
_arguments "${_arguments_options[@]}" : \
'-T+[Override the bookmark template. The argument is a jj template string evaluated once against \`root()\` (no commit context). Default\: \`pr_fetch_bookmark_template\` in config, else \`"pr-" ++ pr_number ++ "/" ++ pr_branch"\`]:TEMPLATE:_default' \
'--template=[Override the bookmark template. The argument is a jj template string evaluated once against \`root()\` (no commit context). Default\: \`pr_fetch_bookmark_template\` in config, else \`"pr-" ++ pr_number ++ "/" ++ pr_branch"\`]:TEMPLATE:_default' \
'--log-level=[Set log level explicitly, overrides \`-v\` and \`-q\`]:LEVEL:_default' \
'--remote=[Git remote used for the user'\''s own pushes and PR head lookups. Precedence\: this flag, then git'\''s auto-detected default push remote, then \`default_remote\` in config]:NAME:_default' \
'--upstream-remote=[Git remote used as the PR target in fork workflows. Precedence\: this flag, then \`upstream_remote\` in config, else \[\`crate\:\:gh\:\:remote\:\:DEFAULT_UPSTREAM_REMOTE\`\]]:NAME:_default' \
'--gh-askpass=[Askpass helper command that prints a GitHub token on stdout; e.g. \`--gh-askpass "op read op\://Vault/gh/token"\`. Highest-priority token source; outranks \`\$GH_ASKPASS\`, the token env vars, and \`gh_askpass\` in config]:CMD:_default' \
'--askpass-timeout=[Timeout in seconds for the askpass helper. Default\: 20]:SECS:_default' \
'-f[Replace an existing local bookmark of the same name]' \
'--force[Replace an existing local bookmark of the same name]' \
'*-v[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'*--verbose[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'(-v --verbose)-q[Drop log level to \`ERROR\`]' \
'(-v --verbose)--quiet[Drop log level to \`ERROR\`]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':pr -- PR number to fetch:_default' \
&& ret=0
;;
(log)
_arguments "${_arguments_options[@]}" : \
'-T+[Override \`pr_log_template\` from config for this invocation. Sets the body of the default \`pr_log\` template alias jj-gh injects. Has no effect if you pass your own \`-T\` / \`--template\` in forwarded \`jj log\` args (after \`--\`)]:TEMPLATE:_default' \
'--log-level=[Set log level explicitly, overrides \`-v\` and \`-q\`]:LEVEL:_default' \
'--remote=[Git remote used for the user'\''s own pushes and PR head lookups. Precedence\: this flag, then git'\''s auto-detected default push remote, then \`default_remote\` in config]:NAME:_default' \
'--upstream-remote=[Git remote used as the PR target in fork workflows. Precedence\: this flag, then \`upstream_remote\` in config, else \[\`crate\:\:gh\:\:remote\:\:DEFAULT_UPSTREAM_REMOTE\`\]]:NAME:_default' \
'--gh-askpass=[Askpass helper command that prints a GitHub token on stdout; e.g. \`--gh-askpass "op read op\://Vault/gh/token"\`. Highest-priority token source; outranks \`\$GH_ASKPASS\`, the token env vars, and \`gh_askpass\` in config]:CMD:_default' \
'--askpass-timeout=[Timeout in seconds for the askpass helper. Default\: 20]:SECS:_default' \
'--nerdfonts[Force enable the use of nerdfont icons in the default \`pr log\` template. Overrides config. Use \`--no-nerdfonts\` to disable]' \
'(--nerdfonts)--no-nerdfonts[Force the default \`pr log\` template not to use nerdfont icons. Overrides config]' \
'*-v[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'*--verbose[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'(-v --verbose)-q[Drop log level to \`ERROR\`]' \
'(-v --verbose)--quiet[Drop log level to \`ERROR\`]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'*::jj_log_args -- Arguments forwarded verbatim to the underlying `jj log` invocation. Pass after `--`, e.g. `jj-gh pr log -- -r '\''mine()'\'' -T builtin_log_compact`. If you pass `-T` / `--template`, the default PR-aware template is not applied:_default' \
&& ret=0
;;
(l)
_arguments "${_arguments_options[@]}" : \
'-T+[Override \`pr_log_template\` from config for this invocation. Sets the body of the default \`pr_log\` template alias jj-gh injects. Has no effect if you pass your own \`-T\` / \`--template\` in forwarded \`jj log\` args (after \`--\`)]:TEMPLATE:_default' \
'--log-level=[Set log level explicitly, overrides \`-v\` and \`-q\`]:LEVEL:_default' \
'--remote=[Git remote used for the user'\''s own pushes and PR head lookups. Precedence\: this flag, then git'\''s auto-detected default push remote, then \`default_remote\` in config]:NAME:_default' \
'--upstream-remote=[Git remote used as the PR target in fork workflows. Precedence\: this flag, then \`upstream_remote\` in config, else \[\`crate\:\:gh\:\:remote\:\:DEFAULT_UPSTREAM_REMOTE\`\]]:NAME:_default' \
'--gh-askpass=[Askpass helper command that prints a GitHub token on stdout; e.g. \`--gh-askpass "op read op\://Vault/gh/token"\`. Highest-priority token source; outranks \`\$GH_ASKPASS\`, the token env vars, and \`gh_askpass\` in config]:CMD:_default' \
'--askpass-timeout=[Timeout in seconds for the askpass helper. Default\: 20]:SECS:_default' \
'--nerdfonts[Force enable the use of nerdfont icons in the default \`pr log\` template. Overrides config. Use \`--no-nerdfonts\` to disable]' \
'(--nerdfonts)--no-nerdfonts[Force the default \`pr log\` template not to use nerdfont icons. Overrides config]' \
'*-v[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'*--verbose[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'(-v --verbose)-q[Drop log level to \`ERROR\`]' \
'(-v --verbose)--quiet[Drop log level to \`ERROR\`]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'*::jj_log_args -- Arguments forwarded verbatim to the underlying `jj log` invocation. Pass after `--`, e.g. `jj-gh pr log -- -r '\''mine()'\'' -T builtin_log_compact`. If you pass `-T` / `--template`, the default PR-aware template is not applied:_default' \
&& ret=0
;;
(restack)
_arguments "${_arguments_options[@]}" : \
'(--json --dry-run)-T+[Template to use in interactive mode; conflicts with \`--json\` and \`--dry-run\`. The same template aliases as \`pr log\` are injected here. See \`jj-gh pr log --help\`]:TEMPLATE:_default' \
'(--json --dry-run)--template=[Template to use in interactive mode; conflicts with \`--json\` and \`--dry-run\`. The same template aliases as \`pr log\` are injected here. See \`jj-gh pr log --help\`]:TEMPLATE:_default' \
'--log-level=[Set log level explicitly, overrides \`-v\` and \`-q\`]:LEVEL:_default' \
'--remote=[Git remote used for the user'\''s own pushes and PR head lookups. Precedence\: this flag, then git'\''s auto-detected default push remote, then \`default_remote\` in config]:NAME:_default' \
'--upstream-remote=[Git remote used as the PR target in fork workflows. Precedence\: this flag, then \`upstream_remote\` in config, else \[\`crate\:\:gh\:\:remote\:\:DEFAULT_UPSTREAM_REMOTE\`\]]:NAME:_default' \
'--gh-askpass=[Askpass helper command that prints a GitHub token on stdout; e.g. \`--gh-askpass "op read op\://Vault/gh/token"\`. Highest-priority token source; outranks \`\$GH_ASKPASS\`, the token env vars, and \`gh_askpass\` in config]:CMD:_default' \
'--askpass-timeout=[Timeout in seconds for the askpass helper. Default\: 20]:SECS:_default' \
'--dry-run[Print the proposed plan and exit without launching the TUI. No PR is updated. Auto-enabled when stdout is not a terminal]' \
'--json[Emit the proposed plan as JSON. Implies \`--dry-run\`]' \
'--nerdfonts[Force enable nerdfont icons in the default restack/log template. Overrides config. Use \`--no-nerdfonts\` to disable]' \
'(--nerdfonts)--no-nerdfonts[Force the default restack/log template not to use nerdfont icons. Overrides config]' \
'*-v[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'*--verbose[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'(-v --verbose)-q[Drop log level to \`ERROR\`]' \
'(-v --verbose)--quiet[Drop log level to \`ERROR\`]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::number_or_rev -- PR number or revision ID to position the cursor on when the TUI opens; if omitted the cursor starts on the first PR in the stack:_default' \
&& ret=0
;;
(rs)
_arguments "${_arguments_options[@]}" : \
'(--json --dry-run)-T+[Template to use in interactive mode; conflicts with \`--json\` and \`--dry-run\`. The same template aliases as \`pr log\` are injected here. See \`jj-gh pr log --help\`]:TEMPLATE:_default' \
'(--json --dry-run)--template=[Template to use in interactive mode; conflicts with \`--json\` and \`--dry-run\`. The same template aliases as \`pr log\` are injected here. See \`jj-gh pr log --help\`]:TEMPLATE:_default' \
'--log-level=[Set log level explicitly, overrides \`-v\` and \`-q\`]:LEVEL:_default' \
'--remote=[Git remote used for the user'\''s own pushes and PR head lookups. Precedence\: this flag, then git'\''s auto-detected default push remote, then \`default_remote\` in config]:NAME:_default' \
'--upstream-remote=[Git remote used as the PR target in fork workflows. Precedence\: this flag, then \`upstream_remote\` in config, else \[\`crate\:\:gh\:\:remote\:\:DEFAULT_UPSTREAM_REMOTE\`\]]:NAME:_default' \
'--gh-askpass=[Askpass helper command that prints a GitHub token on stdout; e.g. \`--gh-askpass "op read op\://Vault/gh/token"\`. Highest-priority token source; outranks \`\$GH_ASKPASS\`, the token env vars, and \`gh_askpass\` in config]:CMD:_default' \
'--askpass-timeout=[Timeout in seconds for the askpass helper. Default\: 20]:SECS:_default' \
'--dry-run[Print the proposed plan and exit without launching the TUI. No PR is updated. Auto-enabled when stdout is not a terminal]' \
'--json[Emit the proposed plan as JSON. Implies \`--dry-run\`]' \
'--nerdfonts[Force enable nerdfont icons in the default restack/log template. Overrides config. Use \`--no-nerdfonts\` to disable]' \
'(--nerdfonts)--no-nerdfonts[Force the default restack/log template not to use nerdfont icons. Overrides config]' \
'*-v[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'*--verbose[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'(-v --verbose)-q[Drop log level to \`ERROR\`]' \
'(-v --verbose)--quiet[Drop log level to \`ERROR\`]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::number_or_rev -- PR number or revision ID to position the cursor on when the TUI opens; if omitted the cursor starts on the first PR in the stack:_default' \
&& ret=0
;;
(retry-failed)
_arguments "${_arguments_options[@]}" : \
'--cancel-timeout=[Seconds to wait for cancelled runs to finalize before re-running. Only meaningful with --cancel]:SECS:_default' \
'--log-level=[Set log level explicitly, overrides \`-v\` and \`-q\`]:LEVEL:_default' \
'--remote=[Git remote used for the user'\''s own pushes and PR head lookups. Precedence\: this flag, then git'\''s auto-detected default push remote, then \`default_remote\` in config]:NAME:_default' \
'--upstream-remote=[Git remote used as the PR target in fork workflows. Precedence\: this flag, then \`upstream_remote\` in config, else \[\`crate\:\:gh\:\:remote\:\:DEFAULT_UPSTREAM_REMOTE\`\]]:NAME:_default' \
'--gh-askpass=[Askpass helper command that prints a GitHub token on stdout; e.g. \`--gh-askpass "op read op\://Vault/gh/token"\`. Highest-priority token source; outranks \`\$GH_ASKPASS\`, the token env vars, and \`gh_askpass\` in config]:CMD:_default' \
'--askpass-timeout=[Timeout in seconds for the askpass helper. Default\: 20]:SECS:_default' \
'--all[Retry failed CI on all local PRs]' \
'--cancel[Cancel any in-progress runs and restart the entire pipeline. Without this flag, the command fails if CI has not yet completed]' \
'*-v[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'*--verbose[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'(-v --verbose)-q[Drop log level to \`ERROR\`]' \
'(-v --verbose)--quiet[Drop log level to \`ERROR\`]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::number_or_rev -- PR number, or revision ID to look up a PR from:_default' \
&& ret=0
;;
(rerun)
_arguments "${_arguments_options[@]}" : \
'--cancel-timeout=[Seconds to wait for cancelled runs to finalize before re-running. Only meaningful with --cancel]:SECS:_default' \
'--log-level=[Set log level explicitly, overrides \`-v\` and \`-q\`]:LEVEL:_default' \
'--remote=[Git remote used for the user'\''s own pushes and PR head lookups. Precedence\: this flag, then git'\''s auto-detected default push remote, then \`default_remote\` in config]:NAME:_default' \
'--upstream-remote=[Git remote used as the PR target in fork workflows. Precedence\: this flag, then \`upstream_remote\` in config, else \[\`crate\:\:gh\:\:remote\:\:DEFAULT_UPSTREAM_REMOTE\`\]]:NAME:_default' \
'--gh-askpass=[Askpass helper command that prints a GitHub token on stdout; e.g. \`--gh-askpass "op read op\://Vault/gh/token"\`. Highest-priority token source; outranks \`\$GH_ASKPASS\`, the token env vars, and \`gh_askpass\` in config]:CMD:_default' \
'--askpass-timeout=[Timeout in seconds for the askpass helper. Default\: 20]:SECS:_default' \
'--all[Retry failed CI on all local PRs]' \
'--cancel[Cancel any in-progress runs and restart the entire pipeline. Without this flag, the command fails if CI has not yet completed]' \
'*-v[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'*--verbose[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'(-v --verbose)-q[Drop log level to \`ERROR\`]' \
'(-v --verbose)--quiet[Drop log level to \`ERROR\`]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::number_or_rev -- PR number, or revision ID to look up a PR from:_default' \
&& ret=0
;;
(url)
_arguments "${_arguments_options[@]}" : \
'--remote=[Git remote used for the user'\''s own pushes and PR head lookups. Precedence\: this flag, then git'\''s auto-detected default push remote, then \`default_remote\` in config]:NAME:_default' \
'--upstream-remote=[Git remote used as the PR target in fork workflows. Precedence\: this flag, then \`upstream_remote\` in config, else the default upstream]:NAME:_default' \
'--log-level=[Set log level explicitly, overrides \`-v\` and \`-q\`]:LEVEL:_default' \
'--gh-askpass=[Askpass helper command that prints a GitHub token on stdout; e.g. \`--gh-askpass "op read op\://Vault/gh/token"\`. Highest-priority token source; outranks \`\$GH_ASKPASS\`, the token env vars, and \`gh_askpass\` in config]:CMD:_default' \
'--askpass-timeout=[Timeout in seconds for the askpass helper. Default\: 20]:SECS:_default' \
'*-v[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'*--verbose[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'(-v --verbose)-q[Drop log level to \`ERROR\`]' \
'(-v --verbose)--quiet[Drop log level to \`ERROR\`]' \
'-h[Print help]' \
'--help[Print help]' \
':number_or_rev -- PR number or revision ID to lookup PR from:_default' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_jj-gh__subcmd__pr__subcmd__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:jj-gh-pr-help-command-$line[1]:"
        case $line[1] in
            (auto-merge)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(create)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(edit)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(fetch)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(log)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(restack)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(retry-failed)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(url)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(debug)
_arguments "${_arguments_options[@]}" : \
'--log-level=[Set log level explicitly, overrides \`-v\` and \`-q\`]:LEVEL:_default' \
'--remote=[Git remote used for the user'\''s own pushes and PR head lookups. Precedence\: this flag, then git'\''s auto-detected default push remote, then \`default_remote\` in config]:NAME:_default' \
'--upstream-remote=[Git remote used as the PR target in fork workflows. Precedence\: this flag, then \`upstream_remote\` in config, else \[\`crate\:\:gh\:\:remote\:\:DEFAULT_UPSTREAM_REMOTE\`\]]:NAME:_default' \
'--gh-askpass=[Askpass helper command that prints a GitHub token on stdout; e.g. \`--gh-askpass "op read op\://Vault/gh/token"\`. Highest-priority token source; outranks \`\$GH_ASKPASS\`, the token env vars, and \`gh_askpass\` in config]:CMD:_default' \
'--askpass-timeout=[Timeout in seconds for the askpass helper. Default\: 20]:SECS:_default' \
'*-v[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'*--verbose[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'(-v --verbose)-q[Drop log level to \`ERROR\`]' \
'(-v --verbose)--quiet[Drop log level to \`ERROR\`]' \
'-h[Print help]' \
'--help[Print help]' \
":: :_jj-gh__subcmd__debug_commands" \
"*::: :->debug" \
&& ret=0

    case $state in
    (debug)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:jj-gh-debug-command-$line[1]:"
        case $line[1] in
            (config)
_arguments "${_arguments_options[@]}" : \
'--log-level=[Set log level explicitly, overrides \`-v\` and \`-q\`]:LEVEL:_default' \
'--remote=[Git remote used for the user'\''s own pushes and PR head lookups. Precedence\: this flag, then git'\''s auto-detected default push remote, then \`default_remote\` in config]:NAME:_default' \
'--upstream-remote=[Git remote used as the PR target in fork workflows. Precedence\: this flag, then \`upstream_remote\` in config, else \[\`crate\:\:gh\:\:remote\:\:DEFAULT_UPSTREAM_REMOTE\`\]]:NAME:_default' \
'--gh-askpass=[Askpass helper command that prints a GitHub token on stdout; e.g. \`--gh-askpass "op read op\://Vault/gh/token"\`. Highest-priority token source; outranks \`\$GH_ASKPASS\`, the token env vars, and \`gh_askpass\` in config]:CMD:_default' \
'--askpass-timeout=[Timeout in seconds for the askpass helper. Default\: 20]:SECS:_default' \
'*-v[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'*--verbose[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'(-v --verbose)-q[Drop log level to \`ERROR\`]' \
'(-v --verbose)--quiet[Drop log level to \`ERROR\`]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(auth)
_arguments "${_arguments_options[@]}" : \
'--log-level=[Set log level explicitly, overrides \`-v\` and \`-q\`]:LEVEL:_default' \
'--remote=[Git remote used for the user'\''s own pushes and PR head lookups. Precedence\: this flag, then git'\''s auto-detected default push remote, then \`default_remote\` in config]:NAME:_default' \
'--upstream-remote=[Git remote used as the PR target in fork workflows. Precedence\: this flag, then \`upstream_remote\` in config, else \[\`crate\:\:gh\:\:remote\:\:DEFAULT_UPSTREAM_REMOTE\`\]]:NAME:_default' \
'--gh-askpass=[Askpass helper command that prints a GitHub token on stdout; e.g. \`--gh-askpass "op read op\://Vault/gh/token"\`. Highest-priority token source; outranks \`\$GH_ASKPASS\`, the token env vars, and \`gh_askpass\` in config]:CMD:_default' \
'--askpass-timeout=[Timeout in seconds for the askpass helper. Default\: 20]:SECS:_default' \
'*-v[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'*--verbose[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'(-v --verbose)-q[Drop log level to \`ERROR\`]' \
'(-v --verbose)--quiet[Drop log level to \`ERROR\`]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(rev)
_arguments "${_arguments_options[@]}" : \
'--log-level=[Set log level explicitly, overrides \`-v\` and \`-q\`]:LEVEL:_default' \
'--remote=[Git remote used for the user'\''s own pushes and PR head lookups. Precedence\: this flag, then git'\''s auto-detected default push remote, then \`default_remote\` in config]:NAME:_default' \
'--upstream-remote=[Git remote used as the PR target in fork workflows. Precedence\: this flag, then \`upstream_remote\` in config, else \[\`crate\:\:gh\:\:remote\:\:DEFAULT_UPSTREAM_REMOTE\`\]]:NAME:_default' \
'--gh-askpass=[Askpass helper command that prints a GitHub token on stdout; e.g. \`--gh-askpass "op read op\://Vault/gh/token"\`. Highest-priority token source; outranks \`\$GH_ASKPASS\`, the token env vars, and \`gh_askpass\` in config]:CMD:_default' \
'--askpass-timeout=[Timeout in seconds for the askpass helper. Default\: 20]:SECS:_default' \
'*-v[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'*--verbose[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'(-v --verbose)-q[Drop log level to \`ERROR\`]' \
'(-v --verbose)--quiet[Drop log level to \`ERROR\`]' \
'-h[Print help]' \
'--help[Print help]' \
':rev:_default' \
&& ret=0
;;
(pr-lookup)
_arguments "${_arguments_options[@]}" : \
'--log-level=[Set log level explicitly, overrides \`-v\` and \`-q\`]:LEVEL:_default' \
'--remote=[Git remote used for the user'\''s own pushes and PR head lookups. Precedence\: this flag, then git'\''s auto-detected default push remote, then \`default_remote\` in config]:NAME:_default' \
'--upstream-remote=[Git remote used as the PR target in fork workflows. Precedence\: this flag, then \`upstream_remote\` in config, else \[\`crate\:\:gh\:\:remote\:\:DEFAULT_UPSTREAM_REMOTE\`\]]:NAME:_default' \
'--gh-askpass=[Askpass helper command that prints a GitHub token on stdout; e.g. \`--gh-askpass "op read op\://Vault/gh/token"\`. Highest-priority token source; outranks \`\$GH_ASKPASS\`, the token env vars, and \`gh_askpass\` in config]:CMD:_default' \
'--askpass-timeout=[Timeout in seconds for the askpass helper. Default\: 20]:SECS:_default' \
'*-v[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'*--verbose[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'(-v --verbose)-q[Drop log level to \`ERROR\`]' \
'(-v --verbose)--quiet[Drop log level to \`ERROR\`]' \
'-h[Print help]' \
'--help[Print help]' \
':rev:_default' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_jj-gh__subcmd__debug__subcmd__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:jj-gh-debug-help-command-$line[1]:"
        case $line[1] in
            (config)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(auth)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(rev)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(pr-lookup)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(completions)
_arguments "${_arguments_options[@]}" : \
'--jj-alias=[Emit an overlay for \`jj <NAME> <tab>\` instead of the standalone \`jj-gh\` script. Pass the jj alias name (e.g. \`pr\`). Must be paired with \`--subcommand\`]:NAME:_default' \
'--subcommand=[jj-gh top-level subcommand whose tree the overlay describes (e.g. \`pr\`). Must be paired with \`--jj-alias\`]:NAME:(pr)' \
'--log-level=[Set log level explicitly, overrides \`-v\` and \`-q\`]:LEVEL:_default' \
'--remote=[Git remote used for the user'\''s own pushes and PR head lookups. Precedence\: this flag, then git'\''s auto-detected default push remote, then \`default_remote\` in config]:NAME:_default' \
'--upstream-remote=[Git remote used as the PR target in fork workflows. Precedence\: this flag, then \`upstream_remote\` in config, else \[\`crate\:\:gh\:\:remote\:\:DEFAULT_UPSTREAM_REMOTE\`\]]:NAME:_default' \
'--gh-askpass=[Askpass helper command that prints a GitHub token on stdout; e.g. \`--gh-askpass "op read op\://Vault/gh/token"\`. Highest-priority token source; outranks \`\$GH_ASKPASS\`, the token env vars, and \`gh_askpass\` in config]:CMD:_default' \
'--askpass-timeout=[Timeout in seconds for the askpass helper. Default\: 20]:SECS:_default' \
'*-v[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'*--verbose[Increase log verbosity (repeat for more, e.g. \`-vv\`)]' \
'(-v --verbose)-q[Drop log level to \`ERROR\`]' \
'(-v --verbose)--quiet[Drop log level to \`ERROR\`]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':shell:(bash elvish fish powershell zsh)' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_jj-gh__subcmd__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:jj-gh-help-command-$line[1]:"
        case $line[1] in
            (pr)
_arguments "${_arguments_options[@]}" : \
":: :_jj-gh__subcmd__help__subcmd__pr_commands" \
"*::: :->pr" \
&& ret=0

    case $state in
    (pr)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:jj-gh-help-pr-command-$line[1]:"
        case $line[1] in
            (auto-merge)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(create)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(edit)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(fetch)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(log)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(restack)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(retry-failed)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(url)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
(debug)
_arguments "${_arguments_options[@]}" : \
":: :_jj-gh__subcmd__help__subcmd__debug_commands" \
"*::: :->debug" \
&& ret=0

    case $state in
    (debug)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:jj-gh-help-debug-command-$line[1]:"
        case $line[1] in
            (config)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(auth)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(rev)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(pr-lookup)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
(completions)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
}

(( $+functions[_jj-gh_commands] )) ||
_jj-gh_commands() {
    local commands; commands=(
'pr:Commands to work with PRs' \
'debug:Diagnostic subcommands. Useful for inspecting the resolved config and pre-flight checks' \
'completions:Generate completions (on stdout) for the specified shell' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'jj-gh commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__completions_commands] )) ||
_jj-gh__subcmd__completions_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh completions commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__debug_commands] )) ||
_jj-gh__subcmd__debug_commands() {
    local commands; commands=(
'config:Print the merged config with the token rendered as \`***\`' \
'auth:Resolve the GitHub token and report success or failure. Never prints the token itself' \
'rev:Resolve a revision and print commit info, ancestor bookmark, remote URLs, and the detected default branch' \
'pr-lookup:Pre-flight lookup for a PR\: resolve the target, check if a PR is already open for the head, and confirm the base branch exists on the remote' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'jj-gh debug commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__debug__subcmd__auth_commands] )) ||
_jj-gh__subcmd__debug__subcmd__auth_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh debug auth commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__debug__subcmd__config_commands] )) ||
_jj-gh__subcmd__debug__subcmd__config_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh debug config commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__debug__subcmd__help_commands] )) ||
_jj-gh__subcmd__debug__subcmd__help_commands() {
    local commands; commands=(
'config:Print the merged config with the token rendered as \`***\`' \
'auth:Resolve the GitHub token and report success or failure. Never prints the token itself' \
'rev:Resolve a revision and print commit info, ancestor bookmark, remote URLs, and the detected default branch' \
'pr-lookup:Pre-flight lookup for a PR\: resolve the target, check if a PR is already open for the head, and confirm the base branch exists on the remote' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'jj-gh debug help commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__debug__subcmd__help__subcmd__auth_commands] )) ||
_jj-gh__subcmd__debug__subcmd__help__subcmd__auth_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh debug help auth commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__debug__subcmd__help__subcmd__config_commands] )) ||
_jj-gh__subcmd__debug__subcmd__help__subcmd__config_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh debug help config commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__debug__subcmd__help__subcmd__help_commands] )) ||
_jj-gh__subcmd__debug__subcmd__help__subcmd__help_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh debug help help commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__debug__subcmd__help__subcmd__pr-lookup_commands] )) ||
_jj-gh__subcmd__debug__subcmd__help__subcmd__pr-lookup_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh debug help pr-lookup commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__debug__subcmd__help__subcmd__rev_commands] )) ||
_jj-gh__subcmd__debug__subcmd__help__subcmd__rev_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh debug help rev commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__debug__subcmd__pr-lookup_commands] )) ||
_jj-gh__subcmd__debug__subcmd__pr-lookup_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh debug pr-lookup commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__debug__subcmd__rev_commands] )) ||
_jj-gh__subcmd__debug__subcmd__rev_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh debug rev commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__help_commands] )) ||
_jj-gh__subcmd__help_commands() {
    local commands; commands=(
'pr:Commands to work with PRs' \
'debug:Diagnostic subcommands. Useful for inspecting the resolved config and pre-flight checks' \
'completions:Generate completions (on stdout) for the specified shell' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'jj-gh help commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__help__subcmd__completions_commands] )) ||
_jj-gh__subcmd__help__subcmd__completions_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh help completions commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__help__subcmd__debug_commands] )) ||
_jj-gh__subcmd__help__subcmd__debug_commands() {
    local commands; commands=(
'config:Print the merged config with the token rendered as \`***\`' \
'auth:Resolve the GitHub token and report success or failure. Never prints the token itself' \
'rev:Resolve a revision and print commit info, ancestor bookmark, remote URLs, and the detected default branch' \
'pr-lookup:Pre-flight lookup for a PR\: resolve the target, check if a PR is already open for the head, and confirm the base branch exists on the remote' \
    )
    _describe -t commands 'jj-gh help debug commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__help__subcmd__debug__subcmd__auth_commands] )) ||
_jj-gh__subcmd__help__subcmd__debug__subcmd__auth_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh help debug auth commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__help__subcmd__debug__subcmd__config_commands] )) ||
_jj-gh__subcmd__help__subcmd__debug__subcmd__config_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh help debug config commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__help__subcmd__debug__subcmd__pr-lookup_commands] )) ||
_jj-gh__subcmd__help__subcmd__debug__subcmd__pr-lookup_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh help debug pr-lookup commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__help__subcmd__debug__subcmd__rev_commands] )) ||
_jj-gh__subcmd__help__subcmd__debug__subcmd__rev_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh help debug rev commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__help__subcmd__help_commands] )) ||
_jj-gh__subcmd__help__subcmd__help_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh help help commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__help__subcmd__pr_commands] )) ||
_jj-gh__subcmd__help__subcmd__pr_commands() {
    local commands; commands=(
'auto-merge:Enable auto-merge on a PR' \
'create:Open your preferred editor to create a PR from a revision' \
'edit:Edit an existing PR'\''s title, body, base, labels, reviewers, draft state, and auto-merge settings via the markdown frontmatter editor flow' \
'fetch:Fetch a pull request into a local bookmark' \
'log:Like \`jj log\`, but injects PR metadata (e.g. number, CI status, URL)' \
'restack:Push the current \`jj\` stack shape up to GitHub by updating each PR'\''s base branch to match its closest stacked ancestor bookmark' \
'retry-failed:Re-run failed CI jobs on a PR, or on all local PRs with failed CI' \
'url:Lookup the PR by the given number or revision ID and print its full URL. This is useful in pipes such as \`jj-gh pr url <rev> | pbcopy\` or \`jj-gh pr url <rev> | wl-copy\`' \
    )
    _describe -t commands 'jj-gh help pr commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__help__subcmd__pr__subcmd__auto-merge_commands] )) ||
_jj-gh__subcmd__help__subcmd__pr__subcmd__auto-merge_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh help pr auto-merge commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__help__subcmd__pr__subcmd__create_commands] )) ||
_jj-gh__subcmd__help__subcmd__pr__subcmd__create_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh help pr create commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__help__subcmd__pr__subcmd__edit_commands] )) ||
_jj-gh__subcmd__help__subcmd__pr__subcmd__edit_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh help pr edit commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__help__subcmd__pr__subcmd__fetch_commands] )) ||
_jj-gh__subcmd__help__subcmd__pr__subcmd__fetch_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh help pr fetch commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__help__subcmd__pr__subcmd__log_commands] )) ||
_jj-gh__subcmd__help__subcmd__pr__subcmd__log_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh help pr log commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__help__subcmd__pr__subcmd__restack_commands] )) ||
_jj-gh__subcmd__help__subcmd__pr__subcmd__restack_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh help pr restack commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__help__subcmd__pr__subcmd__retry-failed_commands] )) ||
_jj-gh__subcmd__help__subcmd__pr__subcmd__retry-failed_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh help pr retry-failed commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__help__subcmd__pr__subcmd__url_commands] )) ||
_jj-gh__subcmd__help__subcmd__pr__subcmd__url_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh help pr url commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__pr_commands] )) ||
_jj-gh__subcmd__pr_commands() {
    local commands; commands=(
'auto-merge:Enable auto-merge on a PR' \
'am:Enable auto-merge on a PR' \
'create:Open your preferred editor to create a PR from a revision' \
'c:Open your preferred editor to create a PR from a revision' \
'edit:Edit an existing PR'\''s title, body, base, labels, reviewers, draft state, and auto-merge settings via the markdown frontmatter editor flow' \
'e:Edit an existing PR'\''s title, body, base, labels, reviewers, draft state, and auto-merge settings via the markdown frontmatter editor flow' \
'fetch:Fetch a pull request into a local bookmark' \
'f:Fetch a pull request into a local bookmark' \
'log:Like \`jj log\`, but injects PR metadata (e.g. number, CI status, URL)' \
'l:Like \`jj log\`, but injects PR metadata (e.g. number, CI status, URL)' \
'restack:Push the current \`jj\` stack shape up to GitHub by updating each PR'\''s base branch to match its closest stacked ancestor bookmark' \
'rs:Push the current \`jj\` stack shape up to GitHub by updating each PR'\''s base branch to match its closest stacked ancestor bookmark' \
'retry-failed:Re-run failed CI jobs on a PR, or on all local PRs with failed CI' \
'rerun:Re-run failed CI jobs on a PR, or on all local PRs with failed CI' \
'url:Lookup the PR by the given number or revision ID and print its full URL. This is useful in pipes such as \`jj-gh pr url <rev> | pbcopy\` or \`jj-gh pr url <rev> | wl-copy\`' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'jj-gh pr commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__pr__subcmd__auto-merge_commands] )) ||
_jj-gh__subcmd__pr__subcmd__auto-merge_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh pr auto-merge commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__pr__subcmd__create_commands] )) ||
_jj-gh__subcmd__pr__subcmd__create_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh pr create commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__pr__subcmd__edit_commands] )) ||
_jj-gh__subcmd__pr__subcmd__edit_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh pr edit commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__pr__subcmd__fetch_commands] )) ||
_jj-gh__subcmd__pr__subcmd__fetch_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh pr fetch commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__pr__subcmd__help_commands] )) ||
_jj-gh__subcmd__pr__subcmd__help_commands() {
    local commands; commands=(
'auto-merge:Enable auto-merge on a PR' \
'create:Open your preferred editor to create a PR from a revision' \
'edit:Edit an existing PR'\''s title, body, base, labels, reviewers, draft state, and auto-merge settings via the markdown frontmatter editor flow' \
'fetch:Fetch a pull request into a local bookmark' \
'log:Like \`jj log\`, but injects PR metadata (e.g. number, CI status, URL)' \
'restack:Push the current \`jj\` stack shape up to GitHub by updating each PR'\''s base branch to match its closest stacked ancestor bookmark' \
'retry-failed:Re-run failed CI jobs on a PR, or on all local PRs with failed CI' \
'url:Lookup the PR by the given number or revision ID and print its full URL. This is useful in pipes such as \`jj-gh pr url <rev> | pbcopy\` or \`jj-gh pr url <rev> | wl-copy\`' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'jj-gh pr help commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__pr__subcmd__help__subcmd__auto-merge_commands] )) ||
_jj-gh__subcmd__pr__subcmd__help__subcmd__auto-merge_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh pr help auto-merge commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__pr__subcmd__help__subcmd__create_commands] )) ||
_jj-gh__subcmd__pr__subcmd__help__subcmd__create_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh pr help create commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__pr__subcmd__help__subcmd__edit_commands] )) ||
_jj-gh__subcmd__pr__subcmd__help__subcmd__edit_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh pr help edit commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__pr__subcmd__help__subcmd__fetch_commands] )) ||
_jj-gh__subcmd__pr__subcmd__help__subcmd__fetch_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh pr help fetch commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__pr__subcmd__help__subcmd__help_commands] )) ||
_jj-gh__subcmd__pr__subcmd__help__subcmd__help_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh pr help help commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__pr__subcmd__help__subcmd__log_commands] )) ||
_jj-gh__subcmd__pr__subcmd__help__subcmd__log_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh pr help log commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__pr__subcmd__help__subcmd__restack_commands] )) ||
_jj-gh__subcmd__pr__subcmd__help__subcmd__restack_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh pr help restack commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__pr__subcmd__help__subcmd__retry-failed_commands] )) ||
_jj-gh__subcmd__pr__subcmd__help__subcmd__retry-failed_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh pr help retry-failed commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__pr__subcmd__help__subcmd__url_commands] )) ||
_jj-gh__subcmd__pr__subcmd__help__subcmd__url_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh pr help url commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__pr__subcmd__log_commands] )) ||
_jj-gh__subcmd__pr__subcmd__log_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh pr log commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__pr__subcmd__restack_commands] )) ||
_jj-gh__subcmd__pr__subcmd__restack_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh pr restack commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__pr__subcmd__retry-failed_commands] )) ||
_jj-gh__subcmd__pr__subcmd__retry-failed_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh pr retry-failed commands' commands "$@"
}
(( $+functions[_jj-gh__subcmd__pr__subcmd__url_commands] )) ||
_jj-gh__subcmd__pr__subcmd__url_commands() {
    local commands; commands=()
    _describe -t commands 'jj-gh pr url commands' commands "$@"
}

if [ "$funcstack[1]" = "_jj-gh" ]; then
    _jj-gh "$@"
else
    compdef _jj-gh jj-gh
fi
