aboutsummaryrefslogtreecommitdiff
path: root/contrib/bitcoind.bash-completion
diff options
context:
space:
mode:
authorRoss Nicoll <[email protected]>2014-04-03 23:51:08 +0100
committerJ Ross Nicoll <[email protected]>2015-10-31 14:49:41 +0000
commit0e852c908c0375ae2bbda345efcb6bfdd313c8ab (patch)
tree2330dd1a6d1dedc72a22273b2d1a08342744624f /contrib/bitcoind.bash-completion
parentUnused currently, but changed to Dogecoin specific stuff incase of future imp... (diff)
downloaddiscoin-0e852c908c0375ae2bbda345efcb6bfdd313c8ab.tar.xz
discoin-0e852c908c0375ae2bbda345efcb6bfdd313c8ab.zip
Replaced remaining references to Bitcoin, with Dogecoin, in Debian contrib.
Diffstat (limited to 'contrib/bitcoind.bash-completion')
-rw-r--r--contrib/bitcoind.bash-completion145
1 files changed, 0 insertions, 145 deletions
diff --git a/contrib/bitcoind.bash-completion b/contrib/bitcoind.bash-completion
deleted file mode 100644
index 1fb740e8d..000000000
--- a/contrib/bitcoind.bash-completion
+++ /dev/null
@@ -1,145 +0,0 @@
-# bash programmable completion for dogecoind(1) and dogecoin-cli(1)
-# Copyright (c) 2012,2014 Christian von Roques <[email protected]>
-# Distributed under the MIT software license, see the accompanying
-# file COPYING or http://www.opensource.org/licenses/mit-license.php.
-
-have dogecoind && {
-
-# call $dogecoind for RPC
-_dogecoin_rpc() {
- # determine already specified args necessary for RPC
- local rpcargs=()
- for i in ${COMP_LINE}; do
- case "$i" in
- -conf=*|-proxy*|-rpc*)
- rpcargs=( "${rpcargs[@]}" "$i" )
- ;;
- esac
- done
- $dogecoind "${rpcargs[@]}" "$@"
-}
-
-# Add dogecoin accounts to COMPREPLY
-_dogecoin_accounts() {
- local accounts
- accounts=$(_dogecoin_rpc listaccounts | awk '/".*"/ { a=$1; gsub(/"/, "", a); print a}')
- COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W "$accounts" -- "$cur" ) )
-}
-
-_dogecoind() {
- local cur prev words=() cword
- local dogecoind
-
- # save and use original argument to invoke dogecoind
- # dogecoind might not be in $PATH
- dogecoind="$1"
-
- COMPREPLY=()
- _get_comp_words_by_ref -n = cur prev words cword
-
- if ((cword > 4)); then
- case ${words[cword-4]} in
- listtransactions)
- 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)
- _bitcoin_accounts
- return 0
- ;;
- getbalance|gettxout|importaddress|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
- ;;
- getblock|getrawtransaction|gettransaction|listaccounts|listreceivedbyaccount|listreceivedbyaddress|sendrawtransaction)
- COMPREPLY=( $( compgen -W "true false" -- "$cur" ) )
- return 0
- ;;
- move|setaccount)
- _dogecoin_accounts
- return 0
- ;;
- esac
- fi
-
- case "$prev" in
- backupwallet|dumpwallet|importwallet)
- _filedir
- return 0
- ;;
- getmempool|lockunspent|setgenerate)
- COMPREPLY=( $( compgen -W "true false" -- "$cur" ) )
- return 0
- ;;
- getaccountaddress|getaddressesbyaccount|getbalance|getnewaddress|getreceivedbyaccount|listtransactions|move|sendfrom|sendmany)
- _dogecoin_accounts
- return 0
- ;;
- esac
-
- case "$cur" in
- -conf=*|-pid=*|-loadblock=*|-wallet=*|-rpcsslcertificatechainfile=*|-rpcsslprivatekeyfile=*)
- 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=$($dogecoind --help 2>&1 | awk '$1 ~ /^-/ { sub(/=.*/, "="); print $1 }' )
- fi
-
- # only parse help if senseful
- if [[ -z "$cur" || "$cur" =~ ^[a-z] ]]; then
- commands=$(_dogecoin_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 _dogecoind dogecoind dogecoin-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