#compdef lnp-cli

autoload -U is-at-least

_lnp-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[@]}" \
'-d+[Data directory path]: :_files -/' \
'--data-dir=[Data directory path]: :_files -/' \
'-c+[Path to the configuration file]: :_files' \
'--config=[Path to the configuration file]: :_files' \
'*-T+[Use Tor]: :_hosts' \
'*--tor-proxy=[Use Tor]: :_hosts' \
'-m+[ZMQ socket name/address to forward all incoming lightning messages]: :_files' \
'--msg-socket=[ZMQ socket name/address to forward all incoming lightning messages]: :_files' \
'-x+[ZMQ socket name/address for daemon control interface]: :_files' \
'--ctl-socket=[ZMQ socket name/address for daemon control interface]: :_files' \
'-n+[Blockchain to use]' \
'--chain=[Blockchain to use]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
":: :_lnp-cli_commands" \
"*::: :->lnp-cli" \
&& ret=0
    case $state in
    (lnp-cli)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:lnp-cli-command-$line[1]:"
        case $line[1] in
            (listen)
_arguments "${_arguments_options[@]}" \
'-i+[IPv4 or IPv6 address to bind to]' \
'--ip=[IPv4 or IPv6 address to bind to]' \
'-p+[Port to use; defaults to the native LN port]' \
'--port=[Port to use; defaults to the native LN port]' \
'-o+[Use overlay protocol (http, websocket etc)]' \
'--overlay=[Use overlay protocol (http, websocket etc)]' \
'-d+[Data directory path]: :_files -/' \
'--data-dir=[Data directory path]: :_files -/' \
'-c+[Path to the configuration file]: :_files' \
'--config=[Path to the configuration file]: :_files' \
'*-T+[Use Tor]: :_hosts' \
'*--tor-proxy=[Use Tor]: :_hosts' \
'-m+[ZMQ socket name/address to forward all incoming lightning messages]: :_files' \
'--msg-socket=[ZMQ socket name/address to forward all incoming lightning messages]: :_files' \
'-x+[ZMQ socket name/address for daemon control interface]: :_files' \
'--ctl-socket=[ZMQ socket name/address for daemon control interface]: :_files' \
'-n+[Blockchain to use]' \
'--chain=[Blockchain to use]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
&& ret=0
;;
(connect)
_arguments "${_arguments_options[@]}" \
'-d+[Data directory path]: :_files -/' \
'--data-dir=[Data directory path]: :_files -/' \
'-c+[Path to the configuration file]: :_files' \
'--config=[Path to the configuration file]: :_files' \
'*-T+[Use Tor]: :_hosts' \
'*--tor-proxy=[Use Tor]: :_hosts' \
'-m+[ZMQ socket name/address to forward all incoming lightning messages]: :_files' \
'--msg-socket=[ZMQ socket name/address to forward all incoming lightning messages]: :_files' \
'-x+[ZMQ socket name/address for daemon control interface]: :_files' \
'--ctl-socket=[ZMQ socket name/address for daemon control interface]: :_files' \
'-n+[Blockchain to use]' \
'--chain=[Blockchain to use]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
':peer -- Address of the remote node, in '<public_key>@<ipv4>|<ipv6>|<onionv2>|<onionv3>\[\:<port>\]' format:' \
&& ret=0
;;
(ping)
_arguments "${_arguments_options[@]}" \
'-d+[Data directory path]: :_files -/' \
'--data-dir=[Data directory path]: :_files -/' \
'-c+[Path to the configuration file]: :_files' \
'--config=[Path to the configuration file]: :_files' \
'*-T+[Use Tor]: :_hosts' \
'*--tor-proxy=[Use Tor]: :_hosts' \
'-m+[ZMQ socket name/address to forward all incoming lightning messages]: :_files' \
'--msg-socket=[ZMQ socket name/address to forward all incoming lightning messages]: :_files' \
'-x+[ZMQ socket name/address for daemon control interface]: :_files' \
'--ctl-socket=[ZMQ socket name/address for daemon control interface]: :_files' \
'-n+[Blockchain to use]' \
'--chain=[Blockchain to use]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
':peer -- Address of the remote node, in '<public_key>@<ipv4>|<ipv6>|<onionv2>|<onionv3>\[\:<port>\]' format:' \
&& ret=0
;;
(info)
_arguments "${_arguments_options[@]}" \
'-d+[Data directory path]: :_files -/' \
'--data-dir=[Data directory path]: :_files -/' \
'-c+[Path to the configuration file]: :_files' \
'--config=[Path to the configuration file]: :_files' \
'*-T+[Use Tor]: :_hosts' \
'*--tor-proxy=[Use Tor]: :_hosts' \
'-m+[ZMQ socket name/address to forward all incoming lightning messages]: :_files' \
'--msg-socket=[ZMQ socket name/address to forward all incoming lightning messages]: :_files' \
'-x+[ZMQ socket name/address for daemon control interface]: :_files' \
'--ctl-socket=[ZMQ socket name/address for daemon control interface]: :_files' \
'-n+[Blockchain to use]' \
'--chain=[Blockchain to use]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
'::subject -- Remote peer address or temporary/permanent/short channel id. If absent, returns information about the node itself:' \
&& ret=0
;;
(peers)
_arguments "${_arguments_options[@]}" \
'-d+[Data directory path]: :_files -/' \
'--data-dir=[Data directory path]: :_files -/' \
'-c+[Path to the configuration file]: :_files' \
'--config=[Path to the configuration file]: :_files' \
'*-T+[Use Tor]: :_hosts' \
'*--tor-proxy=[Use Tor]: :_hosts' \
'-m+[ZMQ socket name/address to forward all incoming lightning messages]: :_files' \
'--msg-socket=[ZMQ socket name/address to forward all incoming lightning messages]: :_files' \
'-x+[ZMQ socket name/address for daemon control interface]: :_files' \
'--ctl-socket=[ZMQ socket name/address for daemon control interface]: :_files' \
'-n+[Blockchain to use]' \
'--chain=[Blockchain to use]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
&& ret=0
;;
(channels)
_arguments "${_arguments_options[@]}" \
'-d+[Data directory path]: :_files -/' \
'--data-dir=[Data directory path]: :_files -/' \
'-c+[Path to the configuration file]: :_files' \
'--config=[Path to the configuration file]: :_files' \
'*-T+[Use Tor]: :_hosts' \
'*--tor-proxy=[Use Tor]: :_hosts' \
'-m+[ZMQ socket name/address to forward all incoming lightning messages]: :_files' \
'--msg-socket=[ZMQ socket name/address to forward all incoming lightning messages]: :_files' \
'-x+[ZMQ socket name/address for daemon control interface]: :_files' \
'--ctl-socket=[ZMQ socket name/address for daemon control interface]: :_files' \
'-n+[Blockchain to use]' \
'--chain=[Blockchain to use]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
&& ret=0
;;
(propose)
_arguments "${_arguments_options[@]}" \
'-d+[Data directory path]: :_files -/' \
'--data-dir=[Data directory path]: :_files -/' \
'-c+[Path to the configuration file]: :_files' \
'--config=[Path to the configuration file]: :_files' \
'*-T+[Use Tor]: :_hosts' \
'*--tor-proxy=[Use Tor]: :_hosts' \
'-m+[ZMQ socket name/address to forward all incoming lightning messages]: :_files' \
'--msg-socket=[ZMQ socket name/address to forward all incoming lightning messages]: :_files' \
'-x+[ZMQ socket name/address for daemon control interface]: :_files' \
'--ctl-socket=[ZMQ socket name/address for daemon control interface]: :_files' \
'-n+[Blockchain to use]' \
'--chain=[Blockchain to use]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
':peer -- Address of the remote node, in '<public_key>@<ipv4>|<ipv6>|<onionv2>|<onionv3>\[\:<port>\]' format:' \
':funding-satoshis -- Amount of satoshis to allocate to the channel (the actual allocation will happen later using `fund` command after the channel acceptance):' \
&& ret=0
;;
(fund)
_arguments "${_arguments_options[@]}" \
'-d+[Data directory path]: :_files -/' \
'--data-dir=[Data directory path]: :_files -/' \
'-c+[Path to the configuration file]: :_files' \
'--config=[Path to the configuration file]: :_files' \
'*-T+[Use Tor]: :_hosts' \
'*--tor-proxy=[Use Tor]: :_hosts' \
'-m+[ZMQ socket name/address to forward all incoming lightning messages]: :_files' \
'--msg-socket=[ZMQ socket name/address to forward all incoming lightning messages]: :_files' \
'-x+[ZMQ socket name/address for daemon control interface]: :_files' \
'--ctl-socket=[ZMQ socket name/address for daemon control interface]: :_files' \
'-n+[Blockchain to use]' \
'--chain=[Blockchain to use]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
':channel -- Accepted channel to which the funding must be added:' \
':funding-outpoint -- Outpoint (in form of <txid>\:<output_no>) which will be used as a channel funding. Output `scriptPubkey` must be equal to the one provided by the `propose` command:' \
&& ret=0
;;
(refill)
_arguments "${_arguments_options[@]}" \
'-d+[Data directory path]: :_files -/' \
'--data-dir=[Data directory path]: :_files -/' \
'-c+[Path to the configuration file]: :_files' \
'--config=[Path to the configuration file]: :_files' \
'*-T+[Use Tor]: :_hosts' \
'*--tor-proxy=[Use Tor]: :_hosts' \
'-m+[ZMQ socket name/address to forward all incoming lightning messages]: :_files' \
'--msg-socket=[ZMQ socket name/address to forward all incoming lightning messages]: :_files' \
'-x+[ZMQ socket name/address for daemon control interface]: :_files' \
'--ctl-socket=[ZMQ socket name/address for daemon control interface]: :_files' \
'-n+[Blockchain to use]' \
'--chain=[Blockchain to use]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
':channel -- Channel to which the funding must be added:' \
':consignment -- Consignment file to read containing information about transfer of RGB20 asset to the funding transaction output:' \
':outpoint -- Locally-controlled outpoint (specified when the invoice was created):' \
':blinding-factor -- Outpoint blinding factor (generated when the invoice was created):' \
&& ret=0
;;
(transfer)
_arguments "${_arguments_options[@]}" \
'-a+[Asset ticker in which the invoice should be issued]' \
'--asset=[Asset ticker in which the invoice should be issued]' \
'-d+[Data directory path]: :_files -/' \
'--data-dir=[Data directory path]: :_files -/' \
'-c+[Path to the configuration file]: :_files' \
'--config=[Path to the configuration file]: :_files' \
'*-T+[Use Tor]: :_hosts' \
'*--tor-proxy=[Use Tor]: :_hosts' \
'-m+[ZMQ socket name/address to forward all incoming lightning messages]: :_files' \
'--msg-socket=[ZMQ socket name/address to forward all incoming lightning messages]: :_files' \
'-x+[ZMQ socket name/address for daemon control interface]: :_files' \
'--ctl-socket=[ZMQ socket name/address for daemon control interface]: :_files' \
'-n+[Blockchain to use]' \
'--chain=[Blockchain to use]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
':channel -- Channel to which the funding must be added:' \
':amount -- Asset amount to invoice, in atomic unit (satoshis or smallest asset unit type):' \
&& ret=0
;;
(invoice)
_arguments "${_arguments_options[@]}" \
'-d+[Data directory path]: :_files -/' \
'--data-dir=[Data directory path]: :_files -/' \
'-c+[Path to the configuration file]: :_files' \
'--config=[Path to the configuration file]: :_files' \
'*-T+[Use Tor]: :_hosts' \
'*--tor-proxy=[Use Tor]: :_hosts' \
'-m+[ZMQ socket name/address to forward all incoming lightning messages]: :_files' \
'--msg-socket=[ZMQ socket name/address to forward all incoming lightning messages]: :_files' \
'-x+[ZMQ socket name/address for daemon control interface]: :_files' \
'--ctl-socket=[ZMQ socket name/address for daemon control interface]: :_files' \
'-n+[Blockchain to use]' \
'--chain=[Blockchain to use]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
':amount -- Asset amount to invoice, in atomic unit (satoshis or smallest asset unit type):' \
'::asset -- Asset ticker in which the invoice should be issued:' \
&& ret=0
;;
(pay)
_arguments "${_arguments_options[@]}" \
'-d+[Data directory path]: :_files -/' \
'--data-dir=[Data directory path]: :_files -/' \
'-c+[Path to the configuration file]: :_files' \
'--config=[Path to the configuration file]: :_files' \
'*-T+[Use Tor]: :_hosts' \
'*--tor-proxy=[Use Tor]: :_hosts' \
'-m+[ZMQ socket name/address to forward all incoming lightning messages]: :_files' \
'--msg-socket=[ZMQ socket name/address to forward all incoming lightning messages]: :_files' \
'-x+[ZMQ socket name/address for daemon control interface]: :_files' \
'--ctl-socket=[ZMQ socket name/address for daemon control interface]: :_files' \
'-n+[Blockchain to use]' \
'--chain=[Blockchain to use]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
':invoice -- Invoice bech32 string:' \
':channel -- Channel from which the payment should happen:' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
&& ret=0
;;
        esac
    ;;
esac
}

(( $+functions[_lnp-cli_commands] )) ||
_lnp-cli_commands() {
    local commands; commands=(
        "listen:Bind to a socket and start listening for incoming LN peer connections" \
"connect:Connect to the remote lightning network peer" \
"ping:Ping remote peer (must be already connected)" \
"info:General information about the running node" \
"peers:Lists existing peer connections" \
"channels:Lists existing channels" \
"propose:Proposes a new channel to the remote peer, which must be already connected" \
"fund:Fund new channel (which must be already accepted by the remote peer) with bitcoins" \
"refill:Adds RGB assets to an existing channel" \
"transfer:Do an invoiceless direct payment" \
"invoice:Create an invoice" \
"pay:Pay the invoice" \
"help:Prints this message or the help of the given subcommand(s)" \
    )
    _describe -t commands 'lnp-cli commands' commands "$@"
}
(( $+functions[_lnp-cli__channels_commands] )) ||
_lnp-cli__channels_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'lnp-cli channels commands' commands "$@"
}
(( $+functions[_lnp-cli__connect_commands] )) ||
_lnp-cli__connect_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'lnp-cli connect commands' commands "$@"
}
(( $+functions[_lnp-cli__fund_commands] )) ||
_lnp-cli__fund_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'lnp-cli fund commands' commands "$@"
}
(( $+functions[_lnp-cli__help_commands] )) ||
_lnp-cli__help_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'lnp-cli help commands' commands "$@"
}
(( $+functions[_lnp-cli__info_commands] )) ||
_lnp-cli__info_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'lnp-cli info commands' commands "$@"
}
(( $+functions[_lnp-cli__invoice_commands] )) ||
_lnp-cli__invoice_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'lnp-cli invoice commands' commands "$@"
}
(( $+functions[_lnp-cli__listen_commands] )) ||
_lnp-cli__listen_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'lnp-cli listen commands' commands "$@"
}
(( $+functions[_lnp-cli__pay_commands] )) ||
_lnp-cli__pay_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'lnp-cli pay commands' commands "$@"
}
(( $+functions[_lnp-cli__peers_commands] )) ||
_lnp-cli__peers_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'lnp-cli peers commands' commands "$@"
}
(( $+functions[_lnp-cli__ping_commands] )) ||
_lnp-cli__ping_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'lnp-cli ping commands' commands "$@"
}
(( $+functions[_lnp-cli__propose_commands] )) ||
_lnp-cli__propose_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'lnp-cli propose commands' commands "$@"
}
(( $+functions[_lnp-cli__refill_commands] )) ||
_lnp-cli__refill_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'lnp-cli refill commands' commands "$@"
}
(( $+functions[_lnp-cli__transfer_commands] )) ||
_lnp-cli__transfer_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'lnp-cli transfer commands' commands "$@"
}

_lnp-cli "$@"