#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
            (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' \
'*-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
;;
(create-channel)
_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' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
':node-addr -- Address of the remote node, in '<public_key>@<ipv4>|<ipv6>|<onionv2>|<onionv3>\[\:<port>\]' format:' \
&& 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=(
        "ping:Ping remote peer" \
"create-channel:Establishes new channel" \
"help:Prints this message or the help of the given subcommand(s)" \
    )
    _describe -t commands 'lnp-cli commands' commands "$@"
}
(( $+functions[_lnp-cli__create-channel_commands] )) ||
_lnp-cli__create-channel_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'lnp-cli create-channel 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__ping_commands] )) ||
_lnp-cli__ping_commands() {
    local commands; commands=(
        
    )
    _describe -t commands 'lnp-cli ping commands' commands "$@"
}

_lnp-cli "$@"