1 # Copyright (c) 2012-2024 The Limenka developers
2 # Distributed under the MIT software license, see the accompanying
3 # file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 5 # call $limenka-cli for RPC
6 _limenka_rpc() {
7 # determine already specified args necessary for RPC
8 local rpcargs=()
9 for i in ${COMP_LINE}; do
10 case "$i" in
11 -conf=*|-datadir=*|-regtest|-rpc*|-testnet|-testnet4)
12 rpcargs=( "${rpcargs[@]}" "$i" )
13 ;;
14 esac
15 done
16 $limenka_cli "${rpcargs[@]}" "$@"
17 }
18 19 _limenka_cli() {
20 local cur prev words=() cword
21 local limenka_cli
22 23 # save and use original argument to invoke limenka-cli for -help, help and RPC
24 # as limenka-cli might not be in $PATH
25 limenka_cli="$1"
26 27 COMPREPLY=()
28 _get_comp_words_by_ref -n = cur prev words cword
29 30