forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
202 changed files
with
8,074 additions
and
3,590 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
# bash programmable completion for groestlcoin-cli(1) | ||
# Copyright (c) 2012-2022 The Bitcoin Core developers | ||
# Distributed under the MIT software license, see the accompanying | ||
# file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
# call $groestlcoin-cli for RPC | ||
_groestlcoin_rpc() { | ||
# determine already specified args necessary for RPC | ||
local rpcargs=() | ||
for i in ${COMP_LINE}; do | ||
case "$i" in | ||
-conf=*|-datadir=*|-regtest|-rpc*|-testnet) | ||
rpcargs=( "${rpcargs[@]}" "$i" ) | ||
;; | ||
esac | ||
done | ||
$groestlcoin_cli "${rpcargs[@]}" "$@" | ||
} | ||
|
||
_groestlcoin_cli() { | ||
local cur prev words=() cword | ||
local groestlcoin_cli | ||
|
||
# save and use original argument to invoke groestlcoin-cli for -help, help and RPC | ||
# as groestlcoin-cli might not be in $PATH | ||
groestlcoin_cli="$1" | ||
|
||
COMPREPLY=() | ||
_get_comp_words_by_ref -n = cur prev words cword | ||
|
||
if ((cword > 5)); then | ||
case ${words[cword-5]} in | ||
sendtoaddress) | ||
COMPREPLY=( $( compgen -W "true false" -- "$cur" ) ) | ||
return 0 | ||
;; | ||
esac | ||
fi | ||
|
||
if ((cword > 4)); then | ||
case ${words[cword-4]} in | ||
importaddress|listtransactions|setban) | ||
COMPREPLY=( $( compgen -W "true false" -- "$cur" ) ) | ||
return 0 | ||
;; | ||
signrawtransactionwithkey|signrawtransactionwithwallet) | ||
COMPREPLY=( $( compgen -W "ALL NONE SINGLE ALL|ANYONECANPAY NONE|ANYONECANPAY SINGLE|ANYONECANPAY" -- "$cur" ) ) | ||
return 0 | ||
;; | ||
esac | ||
fi | ||
|
||
if ((cword > 3)); then | ||
case ${words[cword-3]} in | ||
addmultisigaddress) | ||
return 0 | ||
;; | ||
getbalance|gettxout|importaddress|importpubkey|importprivkey|listreceivedbyaddress|listsinceblock) | ||
COMPREPLY=( $( compgen -W "true false" -- "$cur" ) ) | ||
return 0 | ||
;; | ||
esac | ||
fi | ||
|
||
if ((cword > 2)); then | ||
case ${words[cword-2]} in | ||
addnode) | ||
COMPREPLY=( $( compgen -W "add remove onetry" -- "$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" ) ) | ||
return 0 | ||
;; | ||
esac | ||
fi | ||
|
||
case "$prev" in | ||
backupwallet|dumpwallet|importwallet) | ||
_filedir | ||
return 0 | ||
;; | ||
getaddednodeinfo|getrawmempool|lockunspent) | ||
COMPREPLY=( $( compgen -W "true false" -- "$cur" ) ) | ||
return 0 | ||
;; | ||
getbalance|getnewaddress|listtransactions|sendmany) | ||
return 0 | ||
;; | ||
esac | ||
|
||
case "$cur" in | ||
-conf=*) | ||
cur="${cur#*=}" | ||
_filedir | ||
return 0 | ||
;; | ||
-datadir=*) | ||
cur="${cur#*=}" | ||
_filedir -d | ||
return 0 | ||
;; | ||
-*=*) # prevent nonsense completions | ||
return 0 | ||
;; | ||
*) | ||
local helpopts commands | ||
|
||
# only parse -help if senseful | ||
if [[ -z "$cur" || "$cur" =~ ^- ]]; then | ||
helpopts=$($groestlcoin_cli -help 2>&1 | awk '$1 ~ /^-/ { sub(/=.*/, "="); print $1 }' ) | ||
fi | ||
|
||
# only parse help if senseful | ||
if [[ -z "$cur" || "$cur" =~ ^[a-z] ]]; then | ||
commands=$(_groestlcoin_rpc help 2>/dev/null | awk '$1 ~ /^[a-z]/ { print $1; }') | ||
fi | ||
|
||
COMPREPLY=( $( compgen -W "$helpopts $commands" -- "$cur" ) ) | ||
|
||
# Prevent space if an argument is desired | ||
if [[ $COMPREPLY == *= ]]; then | ||
compopt -o nospace | ||
fi | ||
return 0 | ||
;; | ||
esac | ||
} && | ||
complete -F _groestlcoin_cli groestlcoin-cli | ||
|
||
# Local variables: | ||
# mode: shell-script | ||
# sh-basic-offset: 4 | ||
# sh-indent-comment: t | ||
# indent-tabs-mode: nil | ||
# End: | ||
# ex: ts=4 sw=4 et filetype=sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# bash programmable completion for groestlcoin-tx(1) | ||
# Copyright (c) 2016-2022 The Bitcoin Core developers | ||
# Distributed under the MIT software license, see the accompanying | ||
# file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
_groestlcoin_tx() { | ||
local cur prev words=() cword | ||
local groestlcoin_tx | ||
|
||
# save and use original argument to invoke groestlcoin-tx for -help | ||
# it might not be in $PATH | ||
groestlcoin_tx="$1" | ||
|
||
COMPREPLY=() | ||
_get_comp_words_by_ref -n =: cur prev words cword | ||
|
||
case "$cur" in | ||
load=*:*) | ||
cur="${cur#load=*:}" | ||
_filedir | ||
return 0 | ||
;; | ||
*=*) # prevent attempts to complete other arguments | ||
return 0 | ||
;; | ||
esac | ||
|
||
if [[ "$cword" == 1 || ( "$prev" != "-create" && "$prev" == -* ) ]]; then | ||
# only options (or an uncompletable hex-string) allowed | ||
# parse groestlcoin-tx -help for options | ||
local helpopts | ||
helpopts=$($groestlcoin_tx -help | sed -e '/^ -/ p' -e d ) | ||
COMPREPLY=( $( compgen -W "$helpopts" -- "$cur" ) ) | ||
else | ||
# only commands are allowed | ||
# parse -help for commands | ||
local helpcmds | ||
helpcmds=$($groestlcoin_tx -help | sed -e '1,/Commands:/d' -e 's/=.*/=/' -e '/^ [a-z]/ p' -e d ) | ||
COMPREPLY=( $( compgen -W "$helpcmds" -- "$cur" ) ) | ||
fi | ||
|
||
# Prevent space if an argument is desired | ||
if [[ $COMPREPLY == *= ]]; then | ||
compopt -o nospace | ||
fi | ||
|
||
return 0 | ||
} && | ||
complete -F _groestlcoin_tx groestlcoin-tx | ||
|
||
# Local variables: | ||
# mode: shell-script | ||
# sh-basic-offset: 4 | ||
# sh-indent-comment: t | ||
# indent-tabs-mode: nil | ||
# End: | ||
# ex: ts=4 sw=4 et filetype=sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# bash programmable completion for groestlcoind(1) and groestlcoin-qt(1) | ||
# Copyright (c) 2012-2022 The Bitcoin Core developers | ||
# Distributed under the MIT software license, see the accompanying | ||
# file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
_groestlcoind() { | ||
local cur prev words=() cword | ||
local groestlcoind | ||
|
||
# save and use original argument to invoke groestlcoind for -help | ||
# it might not be in $PATH | ||
groestlcoind="$1" | ||
|
||
COMPREPLY=() | ||
_get_comp_words_by_ref -n = cur prev words cword | ||
|
||
case "$cur" in | ||
-conf=*|-pid=*|-loadblock=*|-rpccookiefile=*|-wallet=*) | ||
cur="${cur#*=}" | ||
_filedir | ||
return 0 | ||
;; | ||
-datadir=*) | ||
cur="${cur#*=}" | ||
_filedir -d | ||
return 0 | ||
;; | ||
-*=*) # prevent nonsense completions | ||
return 0 | ||
;; | ||
*) | ||
|
||
# only parse -help if sensible | ||
if [[ -z "$cur" || "$cur" =~ ^- ]]; then | ||
local helpopts | ||
helpopts=$($groestlcoind -help 2>&1 | awk '$1 ~ /^-/ { sub(/=.*/, "="); print $1 }' ) | ||
COMPREPLY=( $( compgen -W "$helpopts" -- "$cur" ) ) | ||
fi | ||
|
||
# Prevent space if an argument is desired | ||
if [[ $COMPREPLY == *= ]]; then | ||
compopt -o nospace | ||
fi | ||
return 0 | ||
;; | ||
esac | ||
} && | ||
complete -F _groestlcoind groestlcoind groestlcoin-qt | ||
|
||
# Local variables: | ||
# mode: shell-script | ||
# sh-basic-offset: 4 | ||
# sh-indent-comment: t | ||
# indent-tabs-mode: nil | ||
# End: | ||
# ex: ts=4 sw=4 et filetype=sh |
Oops, something went wrong.