#compdef anchor

autoload -U is-at-least

_anchor() {
    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[@]}" : \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_anchor_commands" \
"*::: :->anchor-cli" \
&& ret=0
    case $state in
    (anchor-cli)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:anchor-command-$line[1]:"
        case $line[1] in
            (init)
_arguments "${_arguments_options[@]}" : \
'--package-manager=[Package Manager to use]:PACKAGE_MANAGER:((npm\:"Use npm as the package manager"
yarn\:"Use yarn as the package manager"
pnpm\:"Use pnpm as the package manager"
bun\:"Use bun as the package manager"))' \
'-t+[Rust program template to use]:TEMPLATE:((single\:"Program with a single \`lib.rs\` file (not recommended for production)"
multiple\:"Program with multiple files for instructions, state... (recommended)"))' \
'--template=[Rust program template to use]:TEMPLATE:((single\:"Program with a single \`lib.rs\` file (not recommended for production)"
multiple\:"Program with multiple files for instructions, state... (recommended)"))' \
'--test-template=[Test template to use]:TEST_TEMPLATE:((mocha\:"Generate template for Mocha unit-test"
jest\:"Generate template for Jest unit-test"
rust\:"Generate template for Rust unit-test"
mollusk\:"Generate template for Mollusk Rust unit-test"
litesvm\:"Generate template for LiteSVM rust unit-test"))' \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-j[Use JavaScript instead of TypeScript]' \
'--javascript[Use JavaScript instead of TypeScript]' \
'--no-install[Don'\''t install JavaScript dependencies]' \
'--no-git[Don'\''t initialize git]' \
'--force[Initialize even if there are files]' \
'--install-agent-skills[Install Solana agent skills]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':name -- Workspace name:_default' \
&& ret=0
;;
(build)
_arguments "${_arguments_options[@]}" : \
'-i+[Output directory for the IDL]:IDL:_default' \
'--idl=[Output directory for the IDL]:IDL:_default' \
'-t+[Output directory for the TypeScript IDL]:IDL_TS:_default' \
'--idl-ts=[Output directory for the TypeScript IDL]:IDL_TS:_default' \
'-p+[Name of the program to build]:PROGRAM_NAME:_default' \
'--program-name=[Name of the program to build]:PROGRAM_NAME:_default' \
'-s+[Version of the Solana toolchain to use. For --verifiable builds only]:SOLANA_VERSION:_default' \
'--solana-version=[Version of the Solana toolchain to use. For --verifiable builds only]:SOLANA_VERSION:_default' \
'-d+[Docker image to use. For --verifiable builds only]:DOCKER_IMAGE:_default' \
'--docker-image=[Docker image to use. For --verifiable builds only]:DOCKER_IMAGE:_default' \
'-b+[Bootstrap docker image from scratch, installing all requirements for verifiable builds. Only works for debian-based images]:BOOTSTRAP:(none debian)' \
'--bootstrap=[Bootstrap docker image from scratch, installing all requirements for verifiable builds. Only works for debian-based images]:BOOTSTRAP:(none debian)' \
'*-e+[Environment variables to pass into the docker container]:ENV:_default' \
'*--env=[Environment variables to pass into the docker container]:ENV:_default' \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'--skip-lint[True if the build should not fail even if there are no "CHECK" comments]' \
'--ignore-keys[Skip checking for program ID mismatch between keypair and declare_id]' \
'--no-idl[Do not build the IDL]' \
'-v[True if the build artifact needs to be deterministic and verifiable]' \
'--verifiable[True if the build artifact needs to be deterministic and verifiable]' \
'--no-docs[Suppress doc strings in IDL output]' \
'-h[Print help]' \
'--help[Print help]' \
'*::cargo_args -- Arguments to pass to the underlying `cargo build-sbf` command:_default' \
&& ret=0
;;
(expand)
_arguments "${_arguments_options[@]}" : \
'-p+[Expand only this program]:PROGRAM_NAME:_default' \
'--program-name=[Expand only this program]:PROGRAM_NAME:_default' \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'*::cargo_args -- Arguments to pass to the underlying `cargo expand` command:_default' \
&& ret=0
;;
(verify)
_arguments "${_arguments_options[@]}" : \
'(--current-dir)--repo-url=[The URL of the repository to verify against. Conflicts with \`--current-dir\`]:REPO_URL:_default' \
'--commit-hash=[The commit hash to verify against. Requires \`--repo-url\`]:COMMIT_HASH:_default' \
'--program-name=[Name of the program to run the command on. Defaults to the package name]:PROGRAM_NAME:_default' \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'--current-dir[Verify against the source code in the current directory. Conflicts with \`--repo-url\`]' \
'-h[Print help]' \
'--help[Print help]' \
':program_id -- The program ID to verify:_default' \
'*::args -- Any additional arguments to pass to `solana-verify`:_default' \
&& ret=0
;;
(test)
_arguments "${_arguments_options[@]}" : \
'-p+[Build and test only this program]:PROGRAM_NAME:_default' \
'--program-name=[Build and test only this program]:PROGRAM_NAME:_default' \
'*--run=[Run the test suites under the specified path]:RUN:_default' \
'--validator=[Validator type to use for local testing]:VALIDATOR:((surfpool\:"Use Surfpool validator (default)"
legacy\:"Use Solana test validator"))' \
'*-e+[Environment variables to pass into the docker container]:ENV:_default' \
'*--env=[Environment variables to pass into the docker container]:ENV:_default' \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'--skip-deploy[Use this flag if you want to run tests against previously deployed programs]' \
'--skip-lint[True if the build should not fail even if there are no "CHECK" comments where normally required]' \
'--skip-local-validator[Flag to skip starting a local validator, if the configured cluster url is a localnet]' \
'--skip-build[Flag to skip building the program in the workspace, use this to save time when running test and the program code is not altered]' \
'--no-idl[Do not build the IDL]' \
'--detach[Flag to keep the local validator running after tests to be able to check the transactions]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'*::args:_default' \
&& ret=0
;;
(new)
_arguments "${_arguments_options[@]}" : \
'-t+[Rust program template to use]:TEMPLATE:((single\:"Program with a single \`lib.rs\` file (not recommended for production)"
multiple\:"Program with multiple files for instructions, state... (recommended)"))' \
'--template=[Rust program template to use]:TEMPLATE:((single\:"Program with a single \`lib.rs\` file (not recommended for production)"
multiple\:"Program with multiple files for instructions, state... (recommended)"))' \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'--force[Create new program even if there is already one]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':name -- Program name:_default' \
&& ret=0
;;
(idl)
_arguments "${_arguments_options[@]}" : \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
":: :_anchor__idl_commands" \
"*::: :->idl" \
&& ret=0

    case $state in
    (idl)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:anchor-idl-command-$line[1]:"
        case $line[1] in
            (init)
_arguments "${_arguments_options[@]}" : \
'-f+[]:FILEPATH:_default' \
'--filepath=[]:FILEPATH:_default' \
'--priority-fee=[]:PRIORITY_FEE:_default' \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'--non-canonical[Create non-canonical metadata account (third-party metadata)]' \
'-h[Print help]' \
'--help[Print help]' \
'::program_id -- Program id to initialize IDL for. If not provided, discovers program ID from IDL:_default' \
&& ret=0
;;
(upgrade)
_arguments "${_arguments_options[@]}" : \
'-f+[]:FILEPATH:_default' \
'--filepath=[]:FILEPATH:_default' \
'--priority-fee=[]:PRIORITY_FEE:_default' \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
'::program_id -- Program id to upgrade IDL for. If not provided, discovers program ID from IDL:_default' \
&& ret=0
;;
(build)
_arguments "${_arguments_options[@]}" : \
'-p+[]:PROGRAM_NAME:_default' \
'--program-name=[]:PROGRAM_NAME:_default' \
'-o+[Output file for the IDL (stdout if not specified)]:OUT:_default' \
'--out=[Output file for the IDL (stdout if not specified)]:OUT:_default' \
'-t+[Output file for the TypeScript IDL]:OUT_TS:_default' \
'--out-ts=[Output file for the TypeScript IDL]:OUT_TS:_default' \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'--no-docs[Suppress doc strings in output]' \
'--skip-lint[Do not check for safety comments]' \
'-h[Print help]' \
'--help[Print help]' \
'*::cargo_args -- Arguments to pass to the underlying `cargo test` command:_default' \
&& ret=0
;;
(fetch)
_arguments "${_arguments_options[@]}" : \
'-o+[Output file for the IDL (stdout if not specified)]:OUT:_default' \
'--out=[Output file for the IDL (stdout if not specified)]:OUT:_default' \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'--non-canonical[Fetch non-canonical metadata account (third-party metadata)]' \
'-h[Print help]' \
'--help[Print help]' \
':program_id:_default' \
&& ret=0
;;
(convert)
_arguments "${_arguments_options[@]}" : \
'-o+[Output file for the IDL (stdout if not specified)]:OUT:_default' \
'--out=[Output file for the IDL (stdout if not specified)]:OUT:_default' \
'-p+[Program id to initialize IDL for. If not provided, discovers program ID from IDL]:PROGRAM_ID:_default' \
'--program-id=[Program id to initialize IDL for. If not provided, discovers program ID from IDL]:PROGRAM_ID:_default' \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
':path -- Path to the IDL file:_default' \
&& ret=0
;;
(type)
_arguments "${_arguments_options[@]}" : \
'-o+[Output file for the IDL (stdout if not specified)]:OUT:_default' \
'--out=[Output file for the IDL (stdout if not specified)]:OUT:_default' \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
':path -- Path to the IDL file:_default' \
&& ret=0
;;
(close)
_arguments "${_arguments_options[@]}" : \
'--seed=[The seed used for the metadata account (default\: "idl")]:SEED:_default' \
'--priority-fee=[Priority fees in micro-lamports per compute unit]:PRIORITY_FEE:_default' \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
':program_id -- The program ID:_default' \
&& ret=0
;;
(create-buffer)
_arguments "${_arguments_options[@]}" : \
'-f+[Path to the metadata file]:FILEPATH:_default' \
'--filepath=[Path to the metadata file]:FILEPATH:_default' \
'--priority-fee=[Priority fees in micro-lamports per compute unit]:PRIORITY_FEE:_default' \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(set-buffer-authority)
_arguments "${_arguments_options[@]}" : \
'-n+[The new authority]:NEW_AUTHORITY:_default' \
'--new-authority=[The new authority]:NEW_AUTHORITY:_default' \
'--priority-fee=[Priority fees in micro-lamports per compute unit]:PRIORITY_FEE:_default' \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
':buffer -- The buffer account address:_default' \
&& ret=0
;;
(write-buffer)
_arguments "${_arguments_options[@]}" : \
'-b+[The buffer account address]:BUFFER:_default' \
'--buffer=[The buffer account address]:BUFFER:_default' \
'--seed=[The seed to use for the metadata account (default\: "idl")]:SEED:_default' \
'--priority-fee=[Priority fees in micro-lamports per compute unit]:PRIORITY_FEE:_default' \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'--close-buffer[Close the buffer after writing]' \
'-h[Print help]' \
'--help[Print help]' \
':program_id -- The program ID:_default' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_anchor__idl__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:anchor-idl-help-command-$line[1]:"
        case $line[1] in
            (init)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(upgrade)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(build)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(fetch)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(convert)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(type)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(close)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(create-buffer)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(set-buffer-authority)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(write-buffer)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(clean)
_arguments "${_arguments_options[@]}" : \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(deploy)
_arguments "${_arguments_options[@]}" : \
'-p+[Only deploy this program]:PROGRAM_NAME:_default' \
'--program-name=[Only deploy this program]:PROGRAM_NAME:_default' \
'--program-keypair=[Keypair of the program (filepath) (requires program-name)]:PROGRAM_KEYPAIR:_default' \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-v[If true, deploy from path target/verifiable]' \
'--verifiable[If true, deploy from path target/verifiable]' \
'--no-idl[Don'\''t upload IDL during deployment (IDL is uploaded by default)]' \
'-h[Print help]' \
'--help[Print help]' \
'*::solana_args -- Arguments to pass to the underlying `solana program deploy` command:_default' \
&& ret=0
;;
(migrate)
_arguments "${_arguments_options[@]}" : \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(upgrade)
_arguments "${_arguments_options[@]}" : \
'-p+[The program to upgrade]:PROGRAM_ID:_default' \
'--program-id=[The program to upgrade]:PROGRAM_ID:_default' \
'--max-retries=[Max times to retry on failure]:MAX_RETRIES:_default' \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
':program_filepath -- Filepath to the new program binary:_default' \
'*::solana_args -- Arguments to pass to the underlying `solana program deploy` command:_default' \
&& ret=0
;;
(airdrop)
_arguments "${_arguments_options[@]}" : \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
':amount -- Amount of SOL to airdrop:_default' \
'::pubkey -- Recipient address (defaults to configured wallet):_default' \
&& ret=0
;;
(cluster)
_arguments "${_arguments_options[@]}" : \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
":: :_anchor__cluster_commands" \
"*::: :->cluster" \
&& ret=0

    case $state in
    (cluster)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:anchor-cluster-command-$line[1]:"
        case $line[1] in
            (list)
_arguments "${_arguments_options[@]}" : \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_anchor__cluster__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:anchor-cluster-help-command-$line[1]:"
        case $line[1] in
            (list)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(config)
_arguments "${_arguments_options[@]}" : \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
":: :_anchor__config_commands" \
"*::: :->config" \
&& ret=0

    case $state in
    (config)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:anchor-config-command-$line[1]:"
        case $line[1] in
            (get)
_arguments "${_arguments_options[@]}" : \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(set)
_arguments "${_arguments_options[@]}" : \
'-u+[Cluster to connect to (custom URL). Use -um, -ud, -ut, -ul for standard clusters]:URL:_default' \
'--url=[Cluster to connect to (custom URL). Use -um, -ud, -ut, -ul for standard clusters]:URL:_default' \
'-k+[Path to wallet keypair file to update the Anchor.toml file with]:KEYPAIR:_default' \
'--keypair=[Path to wallet keypair file to update the Anchor.toml file with]:KEYPAIR:_default' \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_anchor__config__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:anchor-config-help-command-$line[1]:"
        case $line[1] in
            (get)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(set)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(shell)
_arguments "${_arguments_options[@]}" : \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(run)
_arguments "${_arguments_options[@]}" : \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
':script -- The name of the script to run:_default' \
'*::script_args -- Argument to pass to the underlying script:_default' \
&& ret=0
;;
(keys)
_arguments "${_arguments_options[@]}" : \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
":: :_anchor__keys_commands" \
"*::: :->keys" \
&& ret=0

    case $state in
    (keys)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:anchor-keys-command-$line[1]:"
        case $line[1] in
            (list)
_arguments "${_arguments_options[@]}" : \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(sync)
_arguments "${_arguments_options[@]}" : \
'-p+[Only sync the given program instead of all programs]:PROGRAM_NAME:_default' \
'--program-name=[Only sync the given program instead of all programs]:PROGRAM_NAME:_default' \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_anchor__keys__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:anchor-keys-help-command-$line[1]:"
        case $line[1] in
            (list)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(sync)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(localnet)
_arguments "${_arguments_options[@]}" : \
'--validator=[Validator type to use for local testing]:VALIDATOR:((surfpool\:"Use Surfpool validator (default)"
legacy\:"Use Solana test validator"))' \
'*-e+[Environment variables to pass into the docker container]:ENV:_default' \
'*--env=[Environment variables to pass into the docker container]:ENV:_default' \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'--skip-build[Flag to skip building the program in the workspace, use this to save time when running test and the program code is not altered]' \
'--skip-deploy[Use this flag if you want to run tests against previously deployed programs]' \
'--skip-lint[True if the build should not fail even if there are no "CHECK" comments where normally required]' \
'--ignore-keys[Skip checking for program ID mismatch between keypair and declare_id]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'*::cargo_args -- Arguments to pass to the underlying `cargo build-sbf` command:_default' \
&& ret=0
;;
(account)
_arguments "${_arguments_options[@]}" : \
'--idl=[IDL to use (defaults to workspace IDL)]:IDL:_default' \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
':account_type -- Account struct to deserialize (format\: <program_name>.<Account>):_default' \
':address -- Address of the account to deserialize:_default' \
&& ret=0
;;
(completions)
_arguments "${_arguments_options[@]}" : \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
':shell:(bash elvish fish powershell zsh)' \
&& ret=0
;;
(address)
_arguments "${_arguments_options[@]}" : \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(balance)
_arguments "${_arguments_options[@]}" : \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'--lamports[Display balance in lamports instead of SOL]' \
'-h[Print help]' \
'--help[Print help]' \
'::pubkey -- Account to check balance for (defaults to configured wallet):_default' \
&& ret=0
;;
(epoch)
_arguments "${_arguments_options[@]}" : \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(epoch-info)
_arguments "${_arguments_options[@]}" : \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(logs)
_arguments "${_arguments_options[@]}" : \
'*--address=[Addresses to filter logs by]:ADDRESS:_default' \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'--include-votes[Include vote transactions when monitoring all transactions]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(show-account)
_arguments "${_arguments_options[@]}" : \
'-o+[Write the account data to this file]:OUTPUT_FILE:_files' \
'--output-file=[Write the account data to this file]:OUTPUT_FILE:_files' \
'--output=[Return information in specified output format]:OUTPUT:(json json-compact)' \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'--lamports[Display balance in lamports instead of SOL]' \
'-h[Print help]' \
'--help[Print help]' \
':account_address -- Account address to show:_default' \
&& ret=0
;;
(keygen)
_arguments "${_arguments_options[@]}" : \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
":: :_anchor__keygen_commands" \
"*::: :->keygen" \
&& ret=0

    case $state in
    (keygen)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:anchor-keygen-command-$line[1]:"
        case $line[1] in
            (new)
_arguments "${_arguments_options[@]}" : \
'-o+[Path to generated keypair file]:OUTFILE:_default' \
'--outfile=[Path to generated keypair file]:OUTFILE:_default' \
'-w+[Number of words in the mnemonic phrase \[possible values\: 12, 15, 18, 21, 24\]]:WORD_COUNT:_default' \
'--word-count=[Number of words in the mnemonic phrase \[possible values\: 12, 15, 18, 21, 24\]]:WORD_COUNT:_default' \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-f[Overwrite the output file if it exists]' \
'--force[Overwrite the output file if it exists]' \
'--no-passphrase[Do not prompt for a passphrase]' \
'--silent[Do not display the generated pubkey]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(pubkey)
_arguments "${_arguments_options[@]}" : \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
'::keypair -- Keypair filepath:_default' \
&& ret=0
;;
(recover)
_arguments "${_arguments_options[@]}" : \
'-o+[Path to recovered keypair file]:OUTFILE:_default' \
'--outfile=[Path to recovered keypair file]:OUTFILE:_default' \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-f[Overwrite the output file if it exists]' \
'--force[Overwrite the output file if it exists]' \
'--skip-seed-phrase-validation[Skip seed phrase validation]' \
'--no-passphrase[Do not prompt for a passphrase]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(verify)
_arguments "${_arguments_options[@]}" : \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
':pubkey -- Public key to verify:_default' \
'::keypair -- Keypair filepath (defaults to configured wallet):_default' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_anchor__keygen__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:anchor-keygen-help-command-$line[1]:"
        case $line[1] in
            (new)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(pubkey)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(recover)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(verify)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(program)
_arguments "${_arguments_options[@]}" : \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
":: :_anchor__program_commands" \
"*::: :->program" \
&& ret=0

    case $state in
    (program)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:anchor-program-command-$line[1]:"
        case $line[1] in
            (deploy)
_arguments "${_arguments_options[@]}" : \
'-p+[Program name to deploy (from workspace). Used when program_filepath is not provided]:PROGRAM_NAME:_default' \
'--program-name=[Program name to deploy (from workspace). Used when program_filepath is not provided]:PROGRAM_NAME:_default' \
'--program-keypair=[Program keypair filepath (defaults to target/deploy/{program_name}-keypair.json)]:PROGRAM_KEYPAIR:_default' \
'--upgrade-authority=[Upgrade authority keypair (defaults to configured wallet)]:UPGRADE_AUTHORITY:_default' \
'--program-id=[Program id to deploy to (derived from program-keypair if not specified)]:PROGRAM_ID:_default' \
'--buffer=[Buffer account to use for deployment]:BUFFER:_default' \
'--max-len=[Maximum transaction length (BPF loader upgradeable limit)]:MAX_LEN:_default' \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'--no-idl[Don'\''t upload IDL during deployment (IDL is uploaded by default)]' \
'--final[Make the program immutable after deployment (cannot be upgraded)]' \
'-h[Print help]' \
'--help[Print help]' \
'::program_filepath -- Program filepath (e.g., target/deploy/my_program.so). If not provided, discovers programs from workspace:_default' \
'*::solana_args -- Additional arguments to configure deployment (e.g., --with-compute-unit-price 1000):_default' \
&& ret=0
;;
(write-buffer)
_arguments "${_arguments_options[@]}" : \
'-p+[Program name to write (from workspace). Used when program_filepath is not provided]:PROGRAM_NAME:_default' \
'--program-name=[Program name to write (from workspace). Used when program_filepath is not provided]:PROGRAM_NAME:_default' \
'--buffer=[Buffer account keypair (defaults to new keypair)]:BUFFER:_default' \
'--buffer-authority=[Buffer authority (defaults to configured wallet)]:BUFFER_AUTHORITY:_default' \
'--max-len=[Maximum transaction length]:MAX_LEN:_default' \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
'::program_filepath -- Program filepath (e.g., target/deploy/my_program.so). If not provided, discovers program from workspace using program_name:_default' \
&& ret=0
;;
(set-buffer-authority)
_arguments "${_arguments_options[@]}" : \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
':buffer -- Buffer account address:_default' \
':new_buffer_authority -- New buffer authority:_default' \
&& ret=0
;;
(set-upgrade-authority)
_arguments "${_arguments_options[@]}" : \
'--new-upgrade-authority=[New upgrade authority pubkey]:NEW_UPGRADE_AUTHORITY:_default' \
'--new-upgrade-authority-signer=[New upgrade authority signer (keypair file). Required unless --skip-new-upgrade-authority-signer-check is used. When provided, both current and new authority will sign (checked mode, recommended)]:NEW_UPGRADE_AUTHORITY_SIGNER:_default' \
'--upgrade-authority=[Current upgrade authority keypair (defaults to configured wallet)]:UPGRADE_AUTHORITY:_default' \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'--skip-new-upgrade-authority-signer-check[Skip new upgrade authority signer check. Allows setting authority with only current authority signature. WARNING\: Less safe - use only if you'\''re confident the pubkey is correct]' \
'--final[Make the program immutable (cannot be upgraded)]' \
'-h[Print help]' \
'--help[Print help]' \
':program_id -- Program id:_default' \
&& ret=0
;;
(show)
_arguments "${_arguments_options[@]}" : \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'--get-programs[Get account information from the Solana config file]' \
'--get-buffers[Get account information from the Solana config file]' \
'--all[Show all accounts]' \
'-h[Print help]' \
'--help[Print help]' \
':account -- Account address (buffer or program):_default' \
&& ret=0
;;
(upgrade)
_arguments "${_arguments_options[@]}" : \
'--program-filepath=[Program filepath (e.g., target/deploy/my_program.so). If not provided, discovers from workspace]:PROGRAM_FILEPATH:_default' \
'-p+[Program name to upgrade (from workspace). Used when program_filepath is not provided]:PROGRAM_NAME:_default' \
'--program-name=[Program name to upgrade (from workspace). Used when program_filepath is not provided]:PROGRAM_NAME:_default' \
'--buffer=[Existing buffer account to upgrade from. If not provided, auto-discovers program from workspace]:BUFFER:_default' \
'--upgrade-authority=[Upgrade authority (defaults to configured wallet)]:UPGRADE_AUTHORITY:_default' \
'--max-retries=[Max times to retry on failure]:MAX_RETRIES:_default' \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
':program_id -- Program id to upgrade:_default' \
'*::solana_args -- Additional arguments to configure deployment (e.g., --with-compute-unit-price 1000):_default' \
&& ret=0
;;
(dump)
_arguments "${_arguments_options[@]}" : \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
':account -- Program account address:_default' \
':output_file -- Output file path:_default' \
&& ret=0
;;
(close)
_arguments "${_arguments_options[@]}" : \
'-p+[Program name to close (from workspace). Used when account is not provided]:PROGRAM_NAME:_default' \
'--program-name=[Program name to close (from workspace). Used when account is not provided]:PROGRAM_NAME:_default' \
'--authority=[Authority keypair (defaults to configured wallet)]:AUTHORITY:_default' \
'--recipient=[Recipient address for reclaimed lamports (defaults to authority)]:RECIPIENT:_default' \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'--bypass-warning[Bypass warning prompts]' \
'-h[Print help]' \
'--help[Print help]' \
'::account -- Account address to close (buffer or program). If not provided, discovers program from workspace using program_name:_default' \
&& ret=0
;;
(extend)
_arguments "${_arguments_options[@]}" : \
'-p+[Program name to extend (from workspace). Used when program_id is not provided]:PROGRAM_NAME:_default' \
'--program-name=[Program name to extend (from workspace). Used when program_id is not provided]:PROGRAM_NAME:_default' \
'--provider.cluster=[Cluster override]:CLUSTER:_default' \
'--provider.wallet=[Wallet override]:WALLET:_default' \
'--commitment=[Commitment override (valid values\: processed, confirmed, finalized)]:COMMITMENT:_default' \
'-h[Print help]' \
'--help[Print help]' \
'::program_id -- Program id to extend. If not provided, discovers program from workspace using program_name:_default' \
':additional_bytes -- Additional bytes to allocate:_default' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_anchor__program__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:anchor-program-help-command-$line[1]:"
        case $line[1] in
            (deploy)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(write-buffer)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(set-buffer-authority)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(set-upgrade-authority)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(show)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(upgrade)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(dump)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(close)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(extend)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_anchor__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:anchor-help-command-$line[1]:"
        case $line[1] in
            (init)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(build)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(expand)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(verify)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(test)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(new)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(idl)
_arguments "${_arguments_options[@]}" : \
":: :_anchor__help__idl_commands" \
"*::: :->idl" \
&& ret=0

    case $state in
    (idl)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:anchor-help-idl-command-$line[1]:"
        case $line[1] in
            (init)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(upgrade)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(build)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(fetch)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(convert)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(type)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(close)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(create-buffer)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(set-buffer-authority)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(write-buffer)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
(clean)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(deploy)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(migrate)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(upgrade)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(airdrop)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(cluster)
_arguments "${_arguments_options[@]}" : \
":: :_anchor__help__cluster_commands" \
"*::: :->cluster" \
&& ret=0

    case $state in
    (cluster)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:anchor-help-cluster-command-$line[1]:"
        case $line[1] in
            (list)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
(config)
_arguments "${_arguments_options[@]}" : \
":: :_anchor__help__config_commands" \
"*::: :->config" \
&& ret=0

    case $state in
    (config)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:anchor-help-config-command-$line[1]:"
        case $line[1] in
            (get)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(set)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
(shell)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(run)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(keys)
_arguments "${_arguments_options[@]}" : \
":: :_anchor__help__keys_commands" \
"*::: :->keys" \
&& ret=0

    case $state in
    (keys)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:anchor-help-keys-command-$line[1]:"
        case $line[1] in
            (list)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(sync)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
(localnet)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(account)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(completions)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(address)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(balance)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(epoch)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(epoch-info)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(logs)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(show-account)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(keygen)
_arguments "${_arguments_options[@]}" : \
":: :_anchor__help__keygen_commands" \
"*::: :->keygen" \
&& ret=0

    case $state in
    (keygen)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:anchor-help-keygen-command-$line[1]:"
        case $line[1] in
            (new)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(pubkey)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(recover)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(verify)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
(program)
_arguments "${_arguments_options[@]}" : \
":: :_anchor__help__program_commands" \
"*::: :->program" \
&& ret=0

    case $state in
    (program)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:anchor-help-program-command-$line[1]:"
        case $line[1] in
            (deploy)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(write-buffer)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(set-buffer-authority)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(set-upgrade-authority)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(show)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(upgrade)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(dump)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(close)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(extend)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
}

(( $+functions[_anchor_commands] )) ||
_anchor_commands() {
    local commands; commands=(
'init:Initializes a workspace' \
'build:Builds the workspace' \
'expand:Expands macros (wrapper around cargo expand)' \
'verify:Verifies the on-chain bytecode matches the locally compiled artifact. Run this command inside a program subdirectory, i.e., in the dir containing the program'\''s Cargo.toml' \
'test:Runs integration tests' \
'new:Creates a new program' \
'idl:Commands for interacting with interface definitions' \
'clean:Remove all artifacts from the generated directories except program keypairs' \
'deploy:Deploys each program in the workspace' \
'migrate:Runs the deploy migration script' \
'upgrade:Deploys, initializes an IDL, and migrates all in one command. Upgrades a single program. The configured wallet must be the upgrade authority' \
'airdrop:Request an airdrop of SOL' \
'cluster:Cluster commands' \
'config:Configuration management commands' \
'shell:Starts a node shell with an Anchor client setup according to the local config' \
'run:Runs the script defined by the current workspace'\''s Anchor.toml' \
'keys:Program keypair commands' \
'localnet:Localnet commands' \
'account:Fetch and deserialize an account using the IDL provided' \
'completions:Generates shell completions' \
'address:Get your public key' \
'balance:Get your balance' \
'epoch:Get current epoch' \
'epoch-info:Get information about the current epoch' \
'logs:Stream transaction logs' \
'show-account:Show the contents of an account' \
'keygen:Keypair generation and management' \
'program:Program deployment and management commands' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'anchor commands' commands "$@"
}
(( $+functions[_anchor__account_commands] )) ||
_anchor__account_commands() {
    local commands; commands=()
    _describe -t commands 'anchor account commands' commands "$@"
}
(( $+functions[_anchor__address_commands] )) ||
_anchor__address_commands() {
    local commands; commands=()
    _describe -t commands 'anchor address commands' commands "$@"
}
(( $+functions[_anchor__airdrop_commands] )) ||
_anchor__airdrop_commands() {
    local commands; commands=()
    _describe -t commands 'anchor airdrop commands' commands "$@"
}
(( $+functions[_anchor__balance_commands] )) ||
_anchor__balance_commands() {
    local commands; commands=()
    _describe -t commands 'anchor balance commands' commands "$@"
}
(( $+functions[_anchor__build_commands] )) ||
_anchor__build_commands() {
    local commands; commands=()
    _describe -t commands 'anchor build commands' commands "$@"
}
(( $+functions[_anchor__clean_commands] )) ||
_anchor__clean_commands() {
    local commands; commands=()
    _describe -t commands 'anchor clean commands' commands "$@"
}
(( $+functions[_anchor__cluster_commands] )) ||
_anchor__cluster_commands() {
    local commands; commands=(
'list:Prints common cluster urls' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'anchor cluster commands' commands "$@"
}
(( $+functions[_anchor__cluster__help_commands] )) ||
_anchor__cluster__help_commands() {
    local commands; commands=(
'list:Prints common cluster urls' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'anchor cluster help commands' commands "$@"
}
(( $+functions[_anchor__cluster__help__help_commands] )) ||
_anchor__cluster__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'anchor cluster help help commands' commands "$@"
}
(( $+functions[_anchor__cluster__help__list_commands] )) ||
_anchor__cluster__help__list_commands() {
    local commands; commands=()
    _describe -t commands 'anchor cluster help list commands' commands "$@"
}
(( $+functions[_anchor__cluster__list_commands] )) ||
_anchor__cluster__list_commands() {
    local commands; commands=()
    _describe -t commands 'anchor cluster list commands' commands "$@"
}
(( $+functions[_anchor__completions_commands] )) ||
_anchor__completions_commands() {
    local commands; commands=()
    _describe -t commands 'anchor completions commands' commands "$@"
}
(( $+functions[_anchor__config_commands] )) ||
_anchor__config_commands() {
    local commands; commands=(
'get:Get configuration settings from the local Anchor.toml' \
'set:Set configuration settings in the local Anchor.toml' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'anchor config commands' commands "$@"
}
(( $+functions[_anchor__config__get_commands] )) ||
_anchor__config__get_commands() {
    local commands; commands=()
    _describe -t commands 'anchor config get commands' commands "$@"
}
(( $+functions[_anchor__config__help_commands] )) ||
_anchor__config__help_commands() {
    local commands; commands=(
'get:Get configuration settings from the local Anchor.toml' \
'set:Set configuration settings in the local Anchor.toml' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'anchor config help commands' commands "$@"
}
(( $+functions[_anchor__config__help__get_commands] )) ||
_anchor__config__help__get_commands() {
    local commands; commands=()
    _describe -t commands 'anchor config help get commands' commands "$@"
}
(( $+functions[_anchor__config__help__help_commands] )) ||
_anchor__config__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'anchor config help help commands' commands "$@"
}
(( $+functions[_anchor__config__help__set_commands] )) ||
_anchor__config__help__set_commands() {
    local commands; commands=()
    _describe -t commands 'anchor config help set commands' commands "$@"
}
(( $+functions[_anchor__config__set_commands] )) ||
_anchor__config__set_commands() {
    local commands; commands=()
    _describe -t commands 'anchor config set commands' commands "$@"
}
(( $+functions[_anchor__deploy_commands] )) ||
_anchor__deploy_commands() {
    local commands; commands=()
    _describe -t commands 'anchor deploy commands' commands "$@"
}
(( $+functions[_anchor__epoch_commands] )) ||
_anchor__epoch_commands() {
    local commands; commands=()
    _describe -t commands 'anchor epoch commands' commands "$@"
}
(( $+functions[_anchor__epoch-info_commands] )) ||
_anchor__epoch-info_commands() {
    local commands; commands=()
    _describe -t commands 'anchor epoch-info commands' commands "$@"
}
(( $+functions[_anchor__expand_commands] )) ||
_anchor__expand_commands() {
    local commands; commands=()
    _describe -t commands 'anchor expand commands' commands "$@"
}
(( $+functions[_anchor__help_commands] )) ||
_anchor__help_commands() {
    local commands; commands=(
'init:Initializes a workspace' \
'build:Builds the workspace' \
'expand:Expands macros (wrapper around cargo expand)' \
'verify:Verifies the on-chain bytecode matches the locally compiled artifact. Run this command inside a program subdirectory, i.e., in the dir containing the program'\''s Cargo.toml' \
'test:Runs integration tests' \
'new:Creates a new program' \
'idl:Commands for interacting with interface definitions' \
'clean:Remove all artifacts from the generated directories except program keypairs' \
'deploy:Deploys each program in the workspace' \
'migrate:Runs the deploy migration script' \
'upgrade:Deploys, initializes an IDL, and migrates all in one command. Upgrades a single program. The configured wallet must be the upgrade authority' \
'airdrop:Request an airdrop of SOL' \
'cluster:Cluster commands' \
'config:Configuration management commands' \
'shell:Starts a node shell with an Anchor client setup according to the local config' \
'run:Runs the script defined by the current workspace'\''s Anchor.toml' \
'keys:Program keypair commands' \
'localnet:Localnet commands' \
'account:Fetch and deserialize an account using the IDL provided' \
'completions:Generates shell completions' \
'address:Get your public key' \
'balance:Get your balance' \
'epoch:Get current epoch' \
'epoch-info:Get information about the current epoch' \
'logs:Stream transaction logs' \
'show-account:Show the contents of an account' \
'keygen:Keypair generation and management' \
'program:Program deployment and management commands' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'anchor help commands' commands "$@"
}
(( $+functions[_anchor__help__account_commands] )) ||
_anchor__help__account_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help account commands' commands "$@"
}
(( $+functions[_anchor__help__address_commands] )) ||
_anchor__help__address_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help address commands' commands "$@"
}
(( $+functions[_anchor__help__airdrop_commands] )) ||
_anchor__help__airdrop_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help airdrop commands' commands "$@"
}
(( $+functions[_anchor__help__balance_commands] )) ||
_anchor__help__balance_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help balance commands' commands "$@"
}
(( $+functions[_anchor__help__build_commands] )) ||
_anchor__help__build_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help build commands' commands "$@"
}
(( $+functions[_anchor__help__clean_commands] )) ||
_anchor__help__clean_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help clean commands' commands "$@"
}
(( $+functions[_anchor__help__cluster_commands] )) ||
_anchor__help__cluster_commands() {
    local commands; commands=(
'list:Prints common cluster urls' \
    )
    _describe -t commands 'anchor help cluster commands' commands "$@"
}
(( $+functions[_anchor__help__cluster__list_commands] )) ||
_anchor__help__cluster__list_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help cluster list commands' commands "$@"
}
(( $+functions[_anchor__help__completions_commands] )) ||
_anchor__help__completions_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help completions commands' commands "$@"
}
(( $+functions[_anchor__help__config_commands] )) ||
_anchor__help__config_commands() {
    local commands; commands=(
'get:Get configuration settings from the local Anchor.toml' \
'set:Set configuration settings in the local Anchor.toml' \
    )
    _describe -t commands 'anchor help config commands' commands "$@"
}
(( $+functions[_anchor__help__config__get_commands] )) ||
_anchor__help__config__get_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help config get commands' commands "$@"
}
(( $+functions[_anchor__help__config__set_commands] )) ||
_anchor__help__config__set_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help config set commands' commands "$@"
}
(( $+functions[_anchor__help__deploy_commands] )) ||
_anchor__help__deploy_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help deploy commands' commands "$@"
}
(( $+functions[_anchor__help__epoch_commands] )) ||
_anchor__help__epoch_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help epoch commands' commands "$@"
}
(( $+functions[_anchor__help__epoch-info_commands] )) ||
_anchor__help__epoch-info_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help epoch-info commands' commands "$@"
}
(( $+functions[_anchor__help__expand_commands] )) ||
_anchor__help__expand_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help expand commands' commands "$@"
}
(( $+functions[_anchor__help__help_commands] )) ||
_anchor__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help help commands' commands "$@"
}
(( $+functions[_anchor__help__idl_commands] )) ||
_anchor__help__idl_commands() {
    local commands; commands=(
'init:Initializes a program'\''s IDL account. Can only be run once' \
'upgrade:Upgrades the IDL to the new file. An alias for first writing and then then setting the idl buffer account' \
'build:Generates the IDL for the program using the compilation method' \
'fetch:Fetches an IDL for the given program from a cluster' \
'convert:Convert legacy IDLs (pre Anchor 0.30) to the new IDL spec' \
'type:Generate TypeScript type for the IDL' \
'close:Close a metadata account and recover rent' \
'create-buffer:Create a buffer account for metadata' \
'set-buffer-authority:Set a new authority on a buffer account' \
'write-buffer:Write metadata using a buffer account' \
    )
    _describe -t commands 'anchor help idl commands' commands "$@"
}
(( $+functions[_anchor__help__idl__build_commands] )) ||
_anchor__help__idl__build_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help idl build commands' commands "$@"
}
(( $+functions[_anchor__help__idl__close_commands] )) ||
_anchor__help__idl__close_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help idl close commands' commands "$@"
}
(( $+functions[_anchor__help__idl__convert_commands] )) ||
_anchor__help__idl__convert_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help idl convert commands' commands "$@"
}
(( $+functions[_anchor__help__idl__create-buffer_commands] )) ||
_anchor__help__idl__create-buffer_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help idl create-buffer commands' commands "$@"
}
(( $+functions[_anchor__help__idl__fetch_commands] )) ||
_anchor__help__idl__fetch_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help idl fetch commands' commands "$@"
}
(( $+functions[_anchor__help__idl__init_commands] )) ||
_anchor__help__idl__init_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help idl init commands' commands "$@"
}
(( $+functions[_anchor__help__idl__set-buffer-authority_commands] )) ||
_anchor__help__idl__set-buffer-authority_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help idl set-buffer-authority commands' commands "$@"
}
(( $+functions[_anchor__help__idl__type_commands] )) ||
_anchor__help__idl__type_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help idl type commands' commands "$@"
}
(( $+functions[_anchor__help__idl__upgrade_commands] )) ||
_anchor__help__idl__upgrade_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help idl upgrade commands' commands "$@"
}
(( $+functions[_anchor__help__idl__write-buffer_commands] )) ||
_anchor__help__idl__write-buffer_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help idl write-buffer commands' commands "$@"
}
(( $+functions[_anchor__help__init_commands] )) ||
_anchor__help__init_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help init commands' commands "$@"
}
(( $+functions[_anchor__help__keygen_commands] )) ||
_anchor__help__keygen_commands() {
    local commands; commands=(
'new:Generate a new keypair' \
'pubkey:Display the pubkey for a given keypair' \
'recover:Recover a keypair from a seed phrase' \
'verify:Verify a keypair can sign and verify a message' \
    )
    _describe -t commands 'anchor help keygen commands' commands "$@"
}
(( $+functions[_anchor__help__keygen__new_commands] )) ||
_anchor__help__keygen__new_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help keygen new commands' commands "$@"
}
(( $+functions[_anchor__help__keygen__pubkey_commands] )) ||
_anchor__help__keygen__pubkey_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help keygen pubkey commands' commands "$@"
}
(( $+functions[_anchor__help__keygen__recover_commands] )) ||
_anchor__help__keygen__recover_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help keygen recover commands' commands "$@"
}
(( $+functions[_anchor__help__keygen__verify_commands] )) ||
_anchor__help__keygen__verify_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help keygen verify commands' commands "$@"
}
(( $+functions[_anchor__help__keys_commands] )) ||
_anchor__help__keys_commands() {
    local commands; commands=(
'list:List all of the program keys' \
'sync:Sync program \`declare_id!\` pubkeys with the program'\''s actual pubkey' \
    )
    _describe -t commands 'anchor help keys commands' commands "$@"
}
(( $+functions[_anchor__help__keys__list_commands] )) ||
_anchor__help__keys__list_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help keys list commands' commands "$@"
}
(( $+functions[_anchor__help__keys__sync_commands] )) ||
_anchor__help__keys__sync_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help keys sync commands' commands "$@"
}
(( $+functions[_anchor__help__localnet_commands] )) ||
_anchor__help__localnet_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help localnet commands' commands "$@"
}
(( $+functions[_anchor__help__logs_commands] )) ||
_anchor__help__logs_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help logs commands' commands "$@"
}
(( $+functions[_anchor__help__migrate_commands] )) ||
_anchor__help__migrate_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help migrate commands' commands "$@"
}
(( $+functions[_anchor__help__new_commands] )) ||
_anchor__help__new_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help new commands' commands "$@"
}
(( $+functions[_anchor__help__program_commands] )) ||
_anchor__help__program_commands() {
    local commands; commands=(
'deploy:Deploy an upgradeable program' \
'write-buffer:Write a program into a buffer account' \
'set-buffer-authority:Set a new buffer authority' \
'set-upgrade-authority:Set a new program authority' \
'show:Display information about a buffer or program' \
'upgrade:Upgrade an upgradeable program' \
'dump:Write the program data to a file' \
'close:Close a program or buffer account and withdraw all lamports' \
'extend:Extend the length of an upgradeable program' \
    )
    _describe -t commands 'anchor help program commands' commands "$@"
}
(( $+functions[_anchor__help__program__close_commands] )) ||
_anchor__help__program__close_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help program close commands' commands "$@"
}
(( $+functions[_anchor__help__program__deploy_commands] )) ||
_anchor__help__program__deploy_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help program deploy commands' commands "$@"
}
(( $+functions[_anchor__help__program__dump_commands] )) ||
_anchor__help__program__dump_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help program dump commands' commands "$@"
}
(( $+functions[_anchor__help__program__extend_commands] )) ||
_anchor__help__program__extend_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help program extend commands' commands "$@"
}
(( $+functions[_anchor__help__program__set-buffer-authority_commands] )) ||
_anchor__help__program__set-buffer-authority_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help program set-buffer-authority commands' commands "$@"
}
(( $+functions[_anchor__help__program__set-upgrade-authority_commands] )) ||
_anchor__help__program__set-upgrade-authority_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help program set-upgrade-authority commands' commands "$@"
}
(( $+functions[_anchor__help__program__show_commands] )) ||
_anchor__help__program__show_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help program show commands' commands "$@"
}
(( $+functions[_anchor__help__program__upgrade_commands] )) ||
_anchor__help__program__upgrade_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help program upgrade commands' commands "$@"
}
(( $+functions[_anchor__help__program__write-buffer_commands] )) ||
_anchor__help__program__write-buffer_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help program write-buffer commands' commands "$@"
}
(( $+functions[_anchor__help__run_commands] )) ||
_anchor__help__run_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help run commands' commands "$@"
}
(( $+functions[_anchor__help__shell_commands] )) ||
_anchor__help__shell_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help shell commands' commands "$@"
}
(( $+functions[_anchor__help__show-account_commands] )) ||
_anchor__help__show-account_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help show-account commands' commands "$@"
}
(( $+functions[_anchor__help__test_commands] )) ||
_anchor__help__test_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help test commands' commands "$@"
}
(( $+functions[_anchor__help__upgrade_commands] )) ||
_anchor__help__upgrade_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help upgrade commands' commands "$@"
}
(( $+functions[_anchor__help__verify_commands] )) ||
_anchor__help__verify_commands() {
    local commands; commands=()
    _describe -t commands 'anchor help verify commands' commands "$@"
}
(( $+functions[_anchor__idl_commands] )) ||
_anchor__idl_commands() {
    local commands; commands=(
'init:Initializes a program'\''s IDL account. Can only be run once' \
'upgrade:Upgrades the IDL to the new file. An alias for first writing and then then setting the idl buffer account' \
'build:Generates the IDL for the program using the compilation method' \
'fetch:Fetches an IDL for the given program from a cluster' \
'convert:Convert legacy IDLs (pre Anchor 0.30) to the new IDL spec' \
'type:Generate TypeScript type for the IDL' \
'close:Close a metadata account and recover rent' \
'create-buffer:Create a buffer account for metadata' \
'set-buffer-authority:Set a new authority on a buffer account' \
'write-buffer:Write metadata using a buffer account' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'anchor idl commands' commands "$@"
}
(( $+functions[_anchor__idl__build_commands] )) ||
_anchor__idl__build_commands() {
    local commands; commands=()
    _describe -t commands 'anchor idl build commands' commands "$@"
}
(( $+functions[_anchor__idl__close_commands] )) ||
_anchor__idl__close_commands() {
    local commands; commands=()
    _describe -t commands 'anchor idl close commands' commands "$@"
}
(( $+functions[_anchor__idl__convert_commands] )) ||
_anchor__idl__convert_commands() {
    local commands; commands=()
    _describe -t commands 'anchor idl convert commands' commands "$@"
}
(( $+functions[_anchor__idl__create-buffer_commands] )) ||
_anchor__idl__create-buffer_commands() {
    local commands; commands=()
    _describe -t commands 'anchor idl create-buffer commands' commands "$@"
}
(( $+functions[_anchor__idl__fetch_commands] )) ||
_anchor__idl__fetch_commands() {
    local commands; commands=()
    _describe -t commands 'anchor idl fetch commands' commands "$@"
}
(( $+functions[_anchor__idl__help_commands] )) ||
_anchor__idl__help_commands() {
    local commands; commands=(
'init:Initializes a program'\''s IDL account. Can only be run once' \
'upgrade:Upgrades the IDL to the new file. An alias for first writing and then then setting the idl buffer account' \
'build:Generates the IDL for the program using the compilation method' \
'fetch:Fetches an IDL for the given program from a cluster' \
'convert:Convert legacy IDLs (pre Anchor 0.30) to the new IDL spec' \
'type:Generate TypeScript type for the IDL' \
'close:Close a metadata account and recover rent' \
'create-buffer:Create a buffer account for metadata' \
'set-buffer-authority:Set a new authority on a buffer account' \
'write-buffer:Write metadata using a buffer account' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'anchor idl help commands' commands "$@"
}
(( $+functions[_anchor__idl__help__build_commands] )) ||
_anchor__idl__help__build_commands() {
    local commands; commands=()
    _describe -t commands 'anchor idl help build commands' commands "$@"
}
(( $+functions[_anchor__idl__help__close_commands] )) ||
_anchor__idl__help__close_commands() {
    local commands; commands=()
    _describe -t commands 'anchor idl help close commands' commands "$@"
}
(( $+functions[_anchor__idl__help__convert_commands] )) ||
_anchor__idl__help__convert_commands() {
    local commands; commands=()
    _describe -t commands 'anchor idl help convert commands' commands "$@"
}
(( $+functions[_anchor__idl__help__create-buffer_commands] )) ||
_anchor__idl__help__create-buffer_commands() {
    local commands; commands=()
    _describe -t commands 'anchor idl help create-buffer commands' commands "$@"
}
(( $+functions[_anchor__idl__help__fetch_commands] )) ||
_anchor__idl__help__fetch_commands() {
    local commands; commands=()
    _describe -t commands 'anchor idl help fetch commands' commands "$@"
}
(( $+functions[_anchor__idl__help__help_commands] )) ||
_anchor__idl__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'anchor idl help help commands' commands "$@"
}
(( $+functions[_anchor__idl__help__init_commands] )) ||
_anchor__idl__help__init_commands() {
    local commands; commands=()
    _describe -t commands 'anchor idl help init commands' commands "$@"
}
(( $+functions[_anchor__idl__help__set-buffer-authority_commands] )) ||
_anchor__idl__help__set-buffer-authority_commands() {
    local commands; commands=()
    _describe -t commands 'anchor idl help set-buffer-authority commands' commands "$@"
}
(( $+functions[_anchor__idl__help__type_commands] )) ||
_anchor__idl__help__type_commands() {
    local commands; commands=()
    _describe -t commands 'anchor idl help type commands' commands "$@"
}
(( $+functions[_anchor__idl__help__upgrade_commands] )) ||
_anchor__idl__help__upgrade_commands() {
    local commands; commands=()
    _describe -t commands 'anchor idl help upgrade commands' commands "$@"
}
(( $+functions[_anchor__idl__help__write-buffer_commands] )) ||
_anchor__idl__help__write-buffer_commands() {
    local commands; commands=()
    _describe -t commands 'anchor idl help write-buffer commands' commands "$@"
}
(( $+functions[_anchor__idl__init_commands] )) ||
_anchor__idl__init_commands() {
    local commands; commands=()
    _describe -t commands 'anchor idl init commands' commands "$@"
}
(( $+functions[_anchor__idl__set-buffer-authority_commands] )) ||
_anchor__idl__set-buffer-authority_commands() {
    local commands; commands=()
    _describe -t commands 'anchor idl set-buffer-authority commands' commands "$@"
}
(( $+functions[_anchor__idl__type_commands] )) ||
_anchor__idl__type_commands() {
    local commands; commands=()
    _describe -t commands 'anchor idl type commands' commands "$@"
}
(( $+functions[_anchor__idl__upgrade_commands] )) ||
_anchor__idl__upgrade_commands() {
    local commands; commands=()
    _describe -t commands 'anchor idl upgrade commands' commands "$@"
}
(( $+functions[_anchor__idl__write-buffer_commands] )) ||
_anchor__idl__write-buffer_commands() {
    local commands; commands=()
    _describe -t commands 'anchor idl write-buffer commands' commands "$@"
}
(( $+functions[_anchor__init_commands] )) ||
_anchor__init_commands() {
    local commands; commands=()
    _describe -t commands 'anchor init commands' commands "$@"
}
(( $+functions[_anchor__keygen_commands] )) ||
_anchor__keygen_commands() {
    local commands; commands=(
'new:Generate a new keypair' \
'pubkey:Display the pubkey for a given keypair' \
'recover:Recover a keypair from a seed phrase' \
'verify:Verify a keypair can sign and verify a message' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'anchor keygen commands' commands "$@"
}
(( $+functions[_anchor__keygen__help_commands] )) ||
_anchor__keygen__help_commands() {
    local commands; commands=(
'new:Generate a new keypair' \
'pubkey:Display the pubkey for a given keypair' \
'recover:Recover a keypair from a seed phrase' \
'verify:Verify a keypair can sign and verify a message' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'anchor keygen help commands' commands "$@"
}
(( $+functions[_anchor__keygen__help__help_commands] )) ||
_anchor__keygen__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'anchor keygen help help commands' commands "$@"
}
(( $+functions[_anchor__keygen__help__new_commands] )) ||
_anchor__keygen__help__new_commands() {
    local commands; commands=()
    _describe -t commands 'anchor keygen help new commands' commands "$@"
}
(( $+functions[_anchor__keygen__help__pubkey_commands] )) ||
_anchor__keygen__help__pubkey_commands() {
    local commands; commands=()
    _describe -t commands 'anchor keygen help pubkey commands' commands "$@"
}
(( $+functions[_anchor__keygen__help__recover_commands] )) ||
_anchor__keygen__help__recover_commands() {
    local commands; commands=()
    _describe -t commands 'anchor keygen help recover commands' commands "$@"
}
(( $+functions[_anchor__keygen__help__verify_commands] )) ||
_anchor__keygen__help__verify_commands() {
    local commands; commands=()
    _describe -t commands 'anchor keygen help verify commands' commands "$@"
}
(( $+functions[_anchor__keygen__new_commands] )) ||
_anchor__keygen__new_commands() {
    local commands; commands=()
    _describe -t commands 'anchor keygen new commands' commands "$@"
}
(( $+functions[_anchor__keygen__pubkey_commands] )) ||
_anchor__keygen__pubkey_commands() {
    local commands; commands=()
    _describe -t commands 'anchor keygen pubkey commands' commands "$@"
}
(( $+functions[_anchor__keygen__recover_commands] )) ||
_anchor__keygen__recover_commands() {
    local commands; commands=()
    _describe -t commands 'anchor keygen recover commands' commands "$@"
}
(( $+functions[_anchor__keygen__verify_commands] )) ||
_anchor__keygen__verify_commands() {
    local commands; commands=()
    _describe -t commands 'anchor keygen verify commands' commands "$@"
}
(( $+functions[_anchor__keys_commands] )) ||
_anchor__keys_commands() {
    local commands; commands=(
'list:List all of the program keys' \
'sync:Sync program \`declare_id!\` pubkeys with the program'\''s actual pubkey' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'anchor keys commands' commands "$@"
}
(( $+functions[_anchor__keys__help_commands] )) ||
_anchor__keys__help_commands() {
    local commands; commands=(
'list:List all of the program keys' \
'sync:Sync program \`declare_id!\` pubkeys with the program'\''s actual pubkey' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'anchor keys help commands' commands "$@"
}
(( $+functions[_anchor__keys__help__help_commands] )) ||
_anchor__keys__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'anchor keys help help commands' commands "$@"
}
(( $+functions[_anchor__keys__help__list_commands] )) ||
_anchor__keys__help__list_commands() {
    local commands; commands=()
    _describe -t commands 'anchor keys help list commands' commands "$@"
}
(( $+functions[_anchor__keys__help__sync_commands] )) ||
_anchor__keys__help__sync_commands() {
    local commands; commands=()
    _describe -t commands 'anchor keys help sync commands' commands "$@"
}
(( $+functions[_anchor__keys__list_commands] )) ||
_anchor__keys__list_commands() {
    local commands; commands=()
    _describe -t commands 'anchor keys list commands' commands "$@"
}
(( $+functions[_anchor__keys__sync_commands] )) ||
_anchor__keys__sync_commands() {
    local commands; commands=()
    _describe -t commands 'anchor keys sync commands' commands "$@"
}
(( $+functions[_anchor__localnet_commands] )) ||
_anchor__localnet_commands() {
    local commands; commands=()
    _describe -t commands 'anchor localnet commands' commands "$@"
}
(( $+functions[_anchor__logs_commands] )) ||
_anchor__logs_commands() {
    local commands; commands=()
    _describe -t commands 'anchor logs commands' commands "$@"
}
(( $+functions[_anchor__migrate_commands] )) ||
_anchor__migrate_commands() {
    local commands; commands=()
    _describe -t commands 'anchor migrate commands' commands "$@"
}
(( $+functions[_anchor__new_commands] )) ||
_anchor__new_commands() {
    local commands; commands=()
    _describe -t commands 'anchor new commands' commands "$@"
}
(( $+functions[_anchor__program_commands] )) ||
_anchor__program_commands() {
    local commands; commands=(
'deploy:Deploy an upgradeable program' \
'write-buffer:Write a program into a buffer account' \
'set-buffer-authority:Set a new buffer authority' \
'set-upgrade-authority:Set a new program authority' \
'show:Display information about a buffer or program' \
'upgrade:Upgrade an upgradeable program' \
'dump:Write the program data to a file' \
'close:Close a program or buffer account and withdraw all lamports' \
'extend:Extend the length of an upgradeable program' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'anchor program commands' commands "$@"
}
(( $+functions[_anchor__program__close_commands] )) ||
_anchor__program__close_commands() {
    local commands; commands=()
    _describe -t commands 'anchor program close commands' commands "$@"
}
(( $+functions[_anchor__program__deploy_commands] )) ||
_anchor__program__deploy_commands() {
    local commands; commands=()
    _describe -t commands 'anchor program deploy commands' commands "$@"
}
(( $+functions[_anchor__program__dump_commands] )) ||
_anchor__program__dump_commands() {
    local commands; commands=()
    _describe -t commands 'anchor program dump commands' commands "$@"
}
(( $+functions[_anchor__program__extend_commands] )) ||
_anchor__program__extend_commands() {
    local commands; commands=()
    _describe -t commands 'anchor program extend commands' commands "$@"
}
(( $+functions[_anchor__program__help_commands] )) ||
_anchor__program__help_commands() {
    local commands; commands=(
'deploy:Deploy an upgradeable program' \
'write-buffer:Write a program into a buffer account' \
'set-buffer-authority:Set a new buffer authority' \
'set-upgrade-authority:Set a new program authority' \
'show:Display information about a buffer or program' \
'upgrade:Upgrade an upgradeable program' \
'dump:Write the program data to a file' \
'close:Close a program or buffer account and withdraw all lamports' \
'extend:Extend the length of an upgradeable program' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'anchor program help commands' commands "$@"
}
(( $+functions[_anchor__program__help__close_commands] )) ||
_anchor__program__help__close_commands() {
    local commands; commands=()
    _describe -t commands 'anchor program help close commands' commands "$@"
}
(( $+functions[_anchor__program__help__deploy_commands] )) ||
_anchor__program__help__deploy_commands() {
    local commands; commands=()
    _describe -t commands 'anchor program help deploy commands' commands "$@"
}
(( $+functions[_anchor__program__help__dump_commands] )) ||
_anchor__program__help__dump_commands() {
    local commands; commands=()
    _describe -t commands 'anchor program help dump commands' commands "$@"
}
(( $+functions[_anchor__program__help__extend_commands] )) ||
_anchor__program__help__extend_commands() {
    local commands; commands=()
    _describe -t commands 'anchor program help extend commands' commands "$@"
}
(( $+functions[_anchor__program__help__help_commands] )) ||
_anchor__program__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'anchor program help help commands' commands "$@"
}
(( $+functions[_anchor__program__help__set-buffer-authority_commands] )) ||
_anchor__program__help__set-buffer-authority_commands() {
    local commands; commands=()
    _describe -t commands 'anchor program help set-buffer-authority commands' commands "$@"
}
(( $+functions[_anchor__program__help__set-upgrade-authority_commands] )) ||
_anchor__program__help__set-upgrade-authority_commands() {
    local commands; commands=()
    _describe -t commands 'anchor program help set-upgrade-authority commands' commands "$@"
}
(( $+functions[_anchor__program__help__show_commands] )) ||
_anchor__program__help__show_commands() {
    local commands; commands=()
    _describe -t commands 'anchor program help show commands' commands "$@"
}
(( $+functions[_anchor__program__help__upgrade_commands] )) ||
_anchor__program__help__upgrade_commands() {
    local commands; commands=()
    _describe -t commands 'anchor program help upgrade commands' commands "$@"
}
(( $+functions[_anchor__program__help__write-buffer_commands] )) ||
_anchor__program__help__write-buffer_commands() {
    local commands; commands=()
    _describe -t commands 'anchor program help write-buffer commands' commands "$@"
}
(( $+functions[_anchor__program__set-buffer-authority_commands] )) ||
_anchor__program__set-buffer-authority_commands() {
    local commands; commands=()
    _describe -t commands 'anchor program set-buffer-authority commands' commands "$@"
}
(( $+functions[_anchor__program__set-upgrade-authority_commands] )) ||
_anchor__program__set-upgrade-authority_commands() {
    local commands; commands=()
    _describe -t commands 'anchor program set-upgrade-authority commands' commands "$@"
}
(( $+functions[_anchor__program__show_commands] )) ||
_anchor__program__show_commands() {
    local commands; commands=()
    _describe -t commands 'anchor program show commands' commands "$@"
}
(( $+functions[_anchor__program__upgrade_commands] )) ||
_anchor__program__upgrade_commands() {
    local commands; commands=()
    _describe -t commands 'anchor program upgrade commands' commands "$@"
}
(( $+functions[_anchor__program__write-buffer_commands] )) ||
_anchor__program__write-buffer_commands() {
    local commands; commands=()
    _describe -t commands 'anchor program write-buffer commands' commands "$@"
}
(( $+functions[_anchor__run_commands] )) ||
_anchor__run_commands() {
    local commands; commands=()
    _describe -t commands 'anchor run commands' commands "$@"
}
(( $+functions[_anchor__shell_commands] )) ||
_anchor__shell_commands() {
    local commands; commands=()
    _describe -t commands 'anchor shell commands' commands "$@"
}
(( $+functions[_anchor__show-account_commands] )) ||
_anchor__show-account_commands() {
    local commands; commands=()
    _describe -t commands 'anchor show-account commands' commands "$@"
}
(( $+functions[_anchor__test_commands] )) ||
_anchor__test_commands() {
    local commands; commands=()
    _describe -t commands 'anchor test commands' commands "$@"
}
(( $+functions[_anchor__upgrade_commands] )) ||
_anchor__upgrade_commands() {
    local commands; commands=()
    _describe -t commands 'anchor upgrade commands' commands "$@"
}
(( $+functions[_anchor__verify_commands] )) ||
_anchor__verify_commands() {
    local commands; commands=()
    _describe -t commands 'anchor verify commands' commands "$@"
}

if [ "$funcstack[1]" = "_anchor" ]; then
    _anchor "$@"
else
    compdef _anchor anchor
fi
