|
|
@ -1,9 +1,9 @@ |
|
|
|
# bash programmable completion for bitcoin-cli(1) |
|
|
|
# bash programmable completion for zcash-cli(1) |
|
|
|
# Copyright (c) 2012-2016 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 $bitcoin-cli for RPC |
|
|
|
# call $zcash-cli for RPC |
|
|
|
_zcash_rpc() { |
|
|
|
# determine already specified args necessary for RPC |
|
|
|
local rpcargs=() |
|
|
@ -14,7 +14,7 @@ _zcash_rpc() { |
|
|
|
;; |
|
|
|
esac |
|
|
|
done |
|
|
|
$bitcoin_cli "${rpcargs[@]}" "$@" |
|
|
|
$zcash_cli "${rpcargs[@]}" "$@" |
|
|
|
} |
|
|
|
|
|
|
|
# Add wallet accounts to COMPREPLY |
|
|
@ -28,11 +28,11 @@ _zcash_accounts() { |
|
|
|
|
|
|
|
_zcash_cli() { |
|
|
|
local cur prev words=() cword |
|
|
|
local bitcoin_cli |
|
|
|
local zcash_cli |
|
|
|
|
|
|
|
# save and use original argument to invoke bitcoin-cli for -help, help and RPC |
|
|
|
# as bitcoin-cli might not be in $PATH |
|
|
|
bitcoin_cli="$1" |
|
|
|
# save and use original argument to invoke zcash-cli for -help, help and RPC |
|
|
|
# as zcash-cli might not be in $PATH |
|
|
|
zcash_cli="$1" |
|
|
|
|
|
|
|
COMPREPLY=() |
|
|
|
_get_comp_words_by_ref -n = cur prev words cword |
|
|
@ -127,7 +127,7 @@ _zcash_cli() { |
|
|
|
|
|
|
|
# only parse -help if senseful |
|
|
|
if [[ -z "$cur" || "$cur" =~ ^- ]]; then |
|
|
|
helpopts=$($bitcoin_cli -help 2>&1 | awk '$1 ~ /^-/ { sub(/=.*/, "="); print $1 }' ) |
|
|
|
helpopts=$($zcash_cli -help 2>&1 | awk '$1 ~ /^-/ { sub(/=.*/, "="); print $1 }' ) |
|
|
|
fi |
|
|
|
|
|
|
|
# only parse help if senseful |