bp_node 0.8.0-alpha.2

BP Node: bitcoin blockchain indexing and notification service
#compdef bp-cli

autoload -U is-at-least

_bp-cli() {
    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[@]}" \
'-R+[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'--rpc=[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'-h[Print help information]' \
'--help[Print help information]' \
'-V[Print version information]' \
'--version[Print version information]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
":: :_bp-cli_commands" \
"*::: :->bp-cli" \
&& ret=0
    case $state in
    (bp-cli)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:bp-cli-command-$line[1]:"
        case $line[1] in
            (none)
_arguments "${_arguments_options[@]}" \
'-R+[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'--rpc=[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'-h[Print help information]' \
'--help[Print help information]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" \
'-R+[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'--rpc=[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
'*::subcommand -- The subcommand whose help message to display:' \
&& ret=0
;;
        esac
    ;;
esac
}

(( $+functions[_bp-cli_commands] )) ||
_bp-cli_commands() {
    local commands; commands=(
'none:' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'bp-cli commands' commands "$@"
}
(( $+functions[_bp-cli__help_commands] )) ||
_bp-cli__help_commands() {
    local commands; commands=()
    _describe -t commands 'bp-cli help commands' commands "$@"
}
(( $+functions[_bp-cli__none_commands] )) ||
_bp-cli__none_commands() {
    local commands; commands=()
    _describe -t commands 'bp-cli none commands' commands "$@"
}

_bp-cli "$@"