Delete the kmd bash completion scripts which I originally wrote, lol
This commit is contained in:
@@ -1,160 +0,0 @@
|
|||||||
# bash programmable completion for komodo-cli(1)
|
|
||||||
# Copyright (c) 2012-2016 The Bitcoin Core developers
|
|
||||||
# Distributed under the GPLv3 software license, see the accompanying
|
|
||||||
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
||||||
|
|
||||||
# call $komodo-cli for RPC
|
|
||||||
_komodo_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
|
|
||||||
$komodo_cli "${rpcargs[@]}" "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Add wallet accounts to COMPREPLY
|
|
||||||
_komodo_accounts() {
|
|
||||||
local accounts
|
|
||||||
# Accounts are deprecated in komodo
|
|
||||||
#accounts=$(_komodo_rpc listaccounts | awk -F '"' '{ print $2 }')
|
|
||||||
accounts="\\\"\\\""
|
|
||||||
COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W "$accounts" -- "$cur" ) )
|
|
||||||
}
|
|
||||||
|
|
||||||
_komodo_cli() {
|
|
||||||
local cur prev words=() cword
|
|
||||||
local komodo_cli
|
|
||||||
|
|
||||||
# save and use original argument to invoke komodo-cli for -help, help and RPC
|
|
||||||
# as komodo-cli might not be in $PATH
|
|
||||||
komodo_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
|
|
||||||
;;
|
|
||||||
signrawtransaction)
|
|
||||||
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)
|
|
||||||
_komodo_accounts
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
getbalance|gettxout|importaddress|importpubkey|importprivkey|listreceivedbyaccount|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|listaccounts|listreceivedbyaccount|listreceivedbyaddress|sendrawtransaction)
|
|
||||||
COMPREPLY=( $( compgen -W "true false" -- "$cur" ) )
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
z_importkey|z_importviewingkey)
|
|
||||||
COMPREPLY=( $( compgen -W "yes no whenkeyisnew" -- "$cur" ) )
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
move|setaccount)
|
|
||||||
_komodo_accounts
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "$prev" in
|
|
||||||
backupwallet|dumpwallet|importwallet|z_exportwallet|z_importwallet)
|
|
||||||
_filedir
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
getaddednodeinfo|getrawmempool|lockunspent|setgenerate)
|
|
||||||
COMPREPLY=( $( compgen -W "true false" -- "$cur" ) )
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
getaccountaddress|getaddressesbyaccount|getbalance|getnewaddress|getreceivedbyaccount|listtransactions|move|sendfrom|sendmany)
|
|
||||||
_komodo_accounts
|
|
||||||
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=$($komodo_cli -help 2>&1 | awk '$1 ~ /^-/ { sub(/=.*/, "="); print $1 }' )
|
|
||||||
fi
|
|
||||||
|
|
||||||
# only parse help if senseful
|
|
||||||
if [[ -z "$cur" || "$cur" =~ ^[a-z] ]]; then
|
|
||||||
commands=$(_komodo_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 _komodo_cli komodo-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
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
# bash programmable completion for komodo-tx(1)
|
|
||||||
# Copyright (c) 2016 The Bitcoin Core developers
|
|
||||||
# Distributed under the GPLv3 software license, see the accompanying
|
|
||||||
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
||||||
|
|
||||||
_komodo_tx() {
|
|
||||||
local cur prev words=() cword
|
|
||||||
local komodo_tx
|
|
||||||
|
|
||||||
# save and use original argument to invoke komodo-tx for -help
|
|
||||||
# it might not be in $PATH
|
|
||||||
komodo_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 komodo-tx -help for options
|
|
||||||
local helpopts
|
|
||||||
helpopts=$($komodo_tx -help | sed -e '/^ -/ p' -e d )
|
|
||||||
COMPREPLY=( $( compgen -W "$helpopts" -- "$cur" ) )
|
|
||||||
else
|
|
||||||
# only commands are allowed
|
|
||||||
# parse -help for commands
|
|
||||||
local helpcmds
|
|
||||||
helpcmds=$($komodo_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 _komodo_tx komodo-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
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
# bash programmable completion for komodod(1)
|
|
||||||
# Copyright (c) 2012-2017 The Bitcoin Core developers
|
|
||||||
# Copyright (c) 2016-2017 The komodo developers
|
|
||||||
# Distributed under the GPLv3 software license, see the accompanying
|
|
||||||
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
||||||
|
|
||||||
_komodod() {
|
|
||||||
local cur prev words=() cword
|
|
||||||
local komodod
|
|
||||||
|
|
||||||
# save and use original argument to invoke komodod for -help
|
|
||||||
# it might not be in $PATH
|
|
||||||
komodod="$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=*|-exportdir=*)
|
|
||||||
cur="${cur#*=}"
|
|
||||||
_filedir -d
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
-*=*) # prevent nonsense completions
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
|
|
||||||
# only parse -help if senseful
|
|
||||||
if [[ -z "$cur" || "$cur" =~ ^- ]]; then
|
|
||||||
local helpopts
|
|
||||||
helpopts=$($komodod -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 _komodod komodod
|
|
||||||
|
|
||||||
# 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
|
|
||||||
Reference in New Issue
Block a user