2017-04-06 15:19:30 +00:00
#compdef bitcoin-cli
# ------------------------------------------------------------------------------
# Copyright (c) 2017 Github zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for bitcoin-cli (https://bitcoin.org).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Ian Ker-Seymer (https://github.com/ianks)
#
# ------------------------------------------------------------------------------
_bitcoin-cli() {
local context state line curcontext="$curcontext"
_arguments -C \
-?'[This help message]' \
2020-03-30 03:21:09 +00:00
-conf='[Specify configuration file. Relative paths will be prefixed by datadir location. (default: bitcoin.conf)]:PATH:_files' \
2017-04-06 15:19:30 +00:00
-datadir='[Specify data directory]:PATH:_directories' \
2020-03-30 03:21:09 +00:00
-getinfo='[Get general information from the remote server.]' \
2017-04-06 15:19:30 +00:00
-testnet'[Use the test chain]' \
-regtest'[Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development.]' \
-named'[Pass named instead of positional arguments (default: false)]' \
2020-03-30 03:21:09 +00:00
-stdin'[Read extra arguments from standard input, one per line until EOF/Ctrl-D (recommended for sensitive information such as passphrases)]' \
-rpcport='[Connect to JSON-RPC on <port> (default: 8332, testnet: 18332, regtest: 18443)]: :_guard "[[\:digit\:]]#" "PORT"' \
2017-04-06 15:19:30 +00:00
-rpcwait'[Wait for RPC server to start]' \
-rpcuser='[Username for JSON-RPC connections]:RPCUSER:()' \
-rpcpassword='[Password for JSON-RPC connections]:RPCPASSWORD:()' \
-rpcconnect='[Send commands to node running on <ip> (default: 127.0.0.1)]:RPCCONNECT:_hosts' \
2020-03-30 03:21:09 +00:00
-rpcclienttimeout='[Timeout during HTTP requests, or 0 for no timeout. (default: 900)]: :_guard "[[\:digit\:]]#" "RPCCLIENTTIMEOUT"' \
2017-04-06 15:19:30 +00:00
':subcommand:->subcommand' && ret=0
case $state in
subcommand)
subcommands=(
'getbestblockhash'
'getblock'
'getblockchaininfo'
'getblockcount'
2020-03-30 03:21:09 +00:00
'getblockfilter'
2017-04-06 15:19:30 +00:00
'getblockhash'
'getblockheader'
2020-03-30 03:21:09 +00:00
'getblockstats'
2017-04-06 15:19:30 +00:00
'getchaintips'
2020-03-30 03:21:09 +00:00
'getchaintxstats'
2017-04-06 15:19:30 +00:00
'getdifficulty'
'getmempoolancestors'
'getmempooldescendants'
'getmempoolentry'
'getmempoolinfo'
'getrawmempool'
'gettxout'
'gettxoutproof'
'gettxoutsetinfo'
'preciousblock'
'pruneblockchain'
2020-03-30 03:21:09 +00:00
'savemempool'
'scantxoutset'
2017-04-06 15:19:30 +00:00
'verifychain'
'verifytxoutproof'
'getmemoryinfo'
2020-03-30 03:21:09 +00:00
'getrpcinfo'
2017-04-06 15:19:30 +00:00
'help'
2020-03-30 03:21:09 +00:00
'logging'
2017-04-06 15:19:30 +00:00
'stop'
2020-03-30 03:21:09 +00:00
'uptime'
2017-04-06 15:19:30 +00:00
'generatetoaddress'
'getblocktemplate'
'getmininginfo'
'getnetworkhashps'
'prioritisetransaction'
'submitblock'
2020-03-30 03:21:09 +00:00
'submitheader'
2017-04-06 15:19:30 +00:00
'addnode'
'clearbanned'
'disconnectnode'
'getaddednodeinfo'
'getconnectioncount'
'getnettotals'
'getnetworkinfo'
2020-03-30 03:21:09 +00:00
'getnodeaddresses'
2017-04-06 15:19:30 +00:00
'getpeerinfo'
'listbanned'
'ping'
'setban'
'setnetworkactive'
2020-03-30 03:21:09 +00:00
'analyzepsbt'
'combinepsbt'
'combinerawtransaction'
'converttopsbt'
'createpsbt'
2017-04-06 15:19:30 +00:00
'createrawtransaction'
2020-03-30 03:21:09 +00:00
'decodepsbt'
2017-04-06 15:19:30 +00:00
'decoderawtransaction'
'decodescript'
2020-03-30 03:21:09 +00:00
'finalizepsbt'
2017-07-09 10:14:34 +00:00
'fundrawtransaction'
2017-04-06 15:19:30 +00:00
'getrawtransaction'
2020-03-30 03:21:09 +00:00
'joinpsbts'
2017-04-06 15:19:30 +00:00
'sendrawtransaction'
2020-03-30 03:21:09 +00:00
'signrawtransactionwithkey'
'testmempoolaccept'
'utxoupdatepsbt'
2017-04-06 15:19:30 +00:00
'createmultisig'
2020-03-30 03:21:09 +00:00
'deriveaddresses'
2017-04-06 15:19:30 +00:00
'estimatesmartfee'
2020-03-30 03:21:09 +00:00
'getdescriptorinfo'
2017-04-06 15:19:30 +00:00
'signmessagewithprivkey'
'validateaddress'
'verifymessage'
2017-07-09 10:14:34 +00:00
'abandontransaction'
2020-03-30 03:21:09 +00:00
'abortrescan'
2017-07-09 10:14:34 +00:00
'addmultisigaddress'
'backupwallet'
'bumpfee'
2020-03-30 03:21:09 +00:00
'createwallet'
2017-07-09 10:14:34 +00:00
'dumpprivkey'
'dumpwallet'
2020-03-30 03:21:09 +00:00
'encryptwallet'
'getaddressesbylabel'
'getaddressinfo'
2017-07-09 10:14:34 +00:00
'getbalance'
2020-03-30 03:21:09 +00:00
'getbalances'
2017-07-09 10:14:34 +00:00
'getnewaddress'
'getrawchangeaddress'
'getreceivedbyaddress'
2020-03-30 03:21:09 +00:00
'getreceivedbylabel'
2017-07-09 10:14:34 +00:00
'gettransaction'
'getunconfirmedbalance'
'getwalletinfo'
'importaddress'
'importmulti'
'importprivkey'
'importprunedfunds'
'importpubkey'
'importwallet'
'keypoolrefill'
'listaddressgroupings'
2020-03-30 03:21:09 +00:00
'listlabels'
2017-07-09 10:14:34 +00:00
'listlockunspent'
'listreceivedbyaddress'
2020-03-30 03:21:09 +00:00
'listreceivedbylabel'
2017-07-09 10:14:34 +00:00
'listsinceblock'
'listtransactions'
'listunspent'
2020-03-30 03:21:09 +00:00
'listwalletdir'
'listwallets'
'loadwallet'
2017-07-09 10:14:34 +00:00
'lockunspent'
'removeprunedfunds'
2020-03-30 03:21:09 +00:00
'rescanblockchain'
2017-07-09 10:14:34 +00:00
'sendmany'
'sendtoaddress'
2020-03-30 03:21:09 +00:00
'sethdseed'
'setlabel'
2017-07-09 10:14:34 +00:00
'settxfee'
2020-03-30 03:21:09 +00:00
'setwalletflag'
2017-07-09 10:14:34 +00:00
'signmessage'
2020-03-30 03:21:09 +00:00
'signrawtransactionwithwallet'
'unloadwallet'
'walletcreatefundedpsbt'
2017-07-09 10:14:34 +00:00
'walletlock'
'walletpassphrase'
'walletpassphrasechange'
2020-03-30 03:21:09 +00:00
'walletprocesspsbt'
'getzmqnotifications'
2017-04-06 15:19:30 +00:00
)
_describe -t subcommands 'bitcoin-cli subcommands' subcommands && ret=0
esac
return ret
}
_bitcoin-cli "$@"
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et