Skip to content

Commit

Permalink
contrib: sync bitcoin-cli bash autocompletion
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonOdiwuor committed Sep 10, 2024
1 parent 845842e commit 6a825c1
Showing 1 changed file with 27 additions and 20 deletions.
47 changes: 27 additions & 20 deletions contrib/completions/bash/bitcoin-cli.bash
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# bash programmable completion for bitcoin-cli(1)
# Copyright (c) 2012-2022 The Bitcoin Core developers
# Dynamic bash programmable completion for bitcoin-cli(1)
# DO NOT EDIT THIS FILE BY HAND -- THIS WILL FAIL THE FUNCTIONAL TEST tool_cli_completion
# This file is auto-generated by the functional test tool_cli_completion.
# If you want to modify this file, modify test/functional/tool_cli_completion.py and re-autogenerate
# this file via the --overwrite test flag.

# Copyright (c) 2012-2024 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

Expand Down Expand Up @@ -30,65 +35,67 @@ _bitcoin_cli() {

if ((cword > 5)); then
case ${words[cword-5]} in
sendtoaddress)
COMPREPLY=( $( compgen -W "true false" -- "$cur" ) )
descriptorprocesspsbt)
COMPREPLY=( $( compgen -W "false true" -- "$cur" ) )
return 0
;;
esac
fi

if ((cword > 4)); then
case ${words[cword-4]} in
importaddress|listtransactions|setban)
COMPREPLY=( $( compgen -W "true false" -- "$cur" ) )
createpsbt|createrawtransaction|descriptorprocesspsbt|setban)
COMPREPLY=( $( compgen -W "false true" -- "$cur" ) )
return 0
;;
signrawtransactionwithkey|signrawtransactionwithwallet)
COMPREPLY=( $( compgen -W "ALL NONE SINGLE ALL|ANYONECANPAY NONE|ANYONECANPAY SINGLE|ANYONECANPAY" -- "$cur" ) )
signrawtransactionwithkey)
COMPREPLY=( $( compgen -W "ALL ALL|ANYONECANPAY NONE NONE|ANYONECANPAY SINGLE SINGLE|ANYONECANPAY" -- "$cur" ) )
return 0
;;
esac
fi

if ((cword > 3)); then
case ${words[cword-3]} in
addmultisigaddress)
addnode|converttopsbt|gettxout|gettxoutsetinfo)
COMPREPLY=( $( compgen -W "false true" -- "$cur" ) )
return 0
;;
getbalance|gettxout|importaddress|importpubkey|importprivkey|listreceivedbyaddress|listsinceblock)
COMPREPLY=( $( compgen -W "true false" -- "$cur" ) )
descriptorprocesspsbt)
COMPREPLY=( $( compgen -W "ALL ALL|ANYONECANPAY NONE NONE|ANYONECANPAY SINGLE SINGLE|ANYONECANPAY" -- "$cur" ) )
return 0
;;
esac
fi

if ((cword > 2)); then
case ${words[cword-2]} in
converttopsbt|decoderawtransaction|finalizepsbt|getblockheader|getmempoolancestors|getmempooldescendants|getrawmempool)
COMPREPLY=( $( compgen -W "false true" -- "$cur" ) )
return 0
;;
addnode)
COMPREPLY=( $( compgen -W "add remove onetry" -- "$cur" ) )
COMPREPLY=( $( compgen -W "add onetry remove" -- "$cur" ) )
return 0
;;
setban)
COMPREPLY=( $( compgen -W "add remove" -- "$cur" ) )
return 0
;;
fundrawtransaction|getblock|getblockheader|getmempoolancestors|getmempooldescendants|getrawtransaction|gettransaction|listreceivedbyaddress|sendrawtransaction)
COMPREPLY=( $( compgen -W "true false" -- "$cur" ) )
estimatesmartfee)
COMPREPLY=( $( compgen -W "CONSERVATIVE ECONOMICAL UNSET" -- "$cur" ) )
return 0
;;
esac
fi

case "$prev" in
backupwallet|dumpwallet|importwallet)
dumptxoutset|importmempool|loadtxoutset)
_filedir
return 0
;;
getaddednodeinfo|getrawmempool|lockunspent)
COMPREPLY=( $( compgen -W "true false" -- "$cur" ) )
return 0
;;
getbalance|getnewaddress|listtransactions|sendmany)
getrawmempool|setnetworkactive)
COMPREPLY=( $( compgen -W "false true" -- "$cur" ) )
return 0
;;
esac
Expand Down

0 comments on commit 6a825c1

Please sign in to comment.