Change function names to not clash with Bitcoin, apply to correct binaries
This commit is contained in:
parent
c794f6d33b
commit
58966e96c5
|
@ -4,7 +4,7 @@
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
# call $bitcoin-cli for RPC
|
# call $bitcoin-cli for RPC
|
||||||
_bitcoin_rpc() {
|
_zcash_rpc() {
|
||||||
# determine already specified args necessary for RPC
|
# determine already specified args necessary for RPC
|
||||||
local rpcargs=()
|
local rpcargs=()
|
||||||
for i in ${COMP_LINE}; do
|
for i in ${COMP_LINE}; do
|
||||||
|
@ -18,13 +18,13 @@ _bitcoin_rpc() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Add wallet accounts to COMPREPLY
|
# Add wallet accounts to COMPREPLY
|
||||||
_bitcoin_accounts() {
|
_zcash_accounts() {
|
||||||
local accounts
|
local accounts
|
||||||
accounts=$(_bitcoin_rpc listaccounts | awk -F '"' '{ print $2 }')
|
accounts=$(_zcash_rpc listaccounts | awk -F '"' '{ print $2 }')
|
||||||
COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W "$accounts" -- "$cur" ) )
|
COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W "$accounts" -- "$cur" ) )
|
||||||
}
|
}
|
||||||
|
|
||||||
_bitcoin_cli() {
|
_zcash_cli() {
|
||||||
local cur prev words=() cword
|
local cur prev words=() cword
|
||||||
local bitcoin_cli
|
local bitcoin_cli
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ _bitcoin_cli() {
|
||||||
if ((cword > 3)); then
|
if ((cword > 3)); then
|
||||||
case ${words[cword-3]} in
|
case ${words[cword-3]} in
|
||||||
addmultisigaddress)
|
addmultisigaddress)
|
||||||
_bitcoin_accounts
|
_zcash_accounts
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
getbalance|gettxout|importaddress|importpubkey|importprivkey|listreceivedbyaccount|listreceivedbyaddress|listsinceblock)
|
getbalance|gettxout|importaddress|importpubkey|importprivkey|listreceivedbyaccount|listreceivedbyaddress|listsinceblock)
|
||||||
|
@ -85,7 +85,7 @@ _bitcoin_cli() {
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
move|setaccount)
|
move|setaccount)
|
||||||
_bitcoin_accounts
|
_zcash_accounts
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -101,7 +101,7 @@ _bitcoin_cli() {
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
getaccountaddress|getaddressesbyaccount|getbalance|getnewaddress|getreceivedbyaccount|listtransactions|move|sendfrom|sendmany)
|
getaccountaddress|getaddressesbyaccount|getbalance|getnewaddress|getreceivedbyaccount|listtransactions|move|sendfrom|sendmany)
|
||||||
_bitcoin_accounts
|
_zcash_accounts
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -130,7 +130,7 @@ _bitcoin_cli() {
|
||||||
|
|
||||||
# only parse help if senseful
|
# only parse help if senseful
|
||||||
if [[ -z "$cur" || "$cur" =~ ^[a-z] ]]; then
|
if [[ -z "$cur" || "$cur" =~ ^[a-z] ]]; then
|
||||||
commands=$(_bitcoin_rpc help 2>/dev/null | awk '$1 ~ /^[a-z]/ { print $1; }')
|
commands=$(_zcash_rpc help 2>/dev/null | awk '$1 ~ /^[a-z]/ { print $1; }')
|
||||||
fi
|
fi
|
||||||
|
|
||||||
COMPREPLY=( $( compgen -W "$helpopts $commands" -- "$cur" ) )
|
COMPREPLY=( $( compgen -W "$helpopts $commands" -- "$cur" ) )
|
||||||
|
@ -143,7 +143,7 @@ _bitcoin_cli() {
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
} &&
|
} &&
|
||||||
complete -F _bitcoin_cli bitcoin-cli
|
complete -F _zcash_cli zcash-cli
|
||||||
|
|
||||||
# Local variables:
|
# Local variables:
|
||||||
# mode: shell-script
|
# mode: shell-script
|
||||||
|
|
|
@ -46,7 +46,7 @@ _bitcoin_tx() {
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
} &&
|
} &&
|
||||||
complete -F _bitcoin_tx bitcoin-tx
|
complete -F _bitcoin_tx zcash-tx
|
||||||
|
|
||||||
# Local variables:
|
# Local variables:
|
||||||
# mode: shell-script
|
# mode: shell-script
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
_bitcoind() {
|
_zcashd() {
|
||||||
local cur prev words=() cword
|
local cur prev words=() cword
|
||||||
local bitcoind
|
local bitcoind
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ _bitcoind() {
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
} &&
|
} &&
|
||||||
complete -F _bitcoind bitcoind bitcoin-qt
|
complete -F _zcashd zcashd
|
||||||
|
|
||||||
# Local variables:
|
# Local variables:
|
||||||
# mode: shell-script
|
# mode: shell-script
|
||||||
|
|
Loading…
Reference in New Issue