1
- # bash programmable completion for bitcoind(1)
2
- # Copyright (c) 2012 Christian von Roques <[email protected] >
1
+ # bash programmable completion for bitcoind(1) and bitcoin-cli(1)
2
+ # Copyright (c) 2012,2014 Christian von Roques <[email protected] >
3
3
# Distributed under the MIT/X11 software license, see the accompanying
4
4
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
5
@@ -37,9 +37,35 @@ _bitcoind() {
37
37
COMPREPLY=()
38
38
_get_comp_words_by_ref -n = cur prev words cword
39
39
40
+ if (( cword > 4 )) ; then
41
+ case ${words[cword-4]} in
42
+ signrawtransaction)
43
+ COMPREPLY=( $( compgen -W " ALL NONE SINGLE ALL|ANYONECANPAY NONE|ANYONECANPAY SINGLE|ANYONECANPAY" -- " $cur " ) )
44
+ return 0
45
+ ;;
46
+ esac
47
+ fi
48
+
49
+ if (( cword > 3 )) ; then
50
+ case ${words[cword-3]} in
51
+ addmultisigaddress)
52
+ _bitcoin_accounts
53
+ return 0
54
+ ;;
55
+ gettxout|importprivkey)
56
+ COMPREPLY=( $( compgen -W " true false" -- " $cur " ) )
57
+ return 0
58
+ ;;
59
+ esac
60
+ fi
61
+
40
62
if (( cword > 2 )) ; then
41
63
case ${words[cword-2]} in
42
- listreceivedbyaccount|listreceivedbyaddress)
64
+ addnode)
65
+ COMPREPLY=( $( compgen -W " add remove onetry" -- " $cur " ) )
66
+ return 0
67
+ ;;
68
+ getblock|getrawtransaction|listreceivedbyaccount|listreceivedbyaddress|sendrawtransaction)
43
69
COMPREPLY=( $( compgen -W " true false" -- " $cur " ) )
44
70
return 0
45
71
;;
@@ -51,11 +77,11 @@ _bitcoind() {
51
77
fi
52
78
53
79
case " $prev " in
54
- backupwallet)
80
+ backupwallet|dumpwallet|importwallet )
55
81
_filedir
56
82
return 0
57
83
;;
58
- setgenerate)
84
+ getmempool|lockunspent| setgenerate)
59
85
COMPREPLY=( $( compgen -W " true false" -- " $cur " ) )
60
86
return 0
61
87
;;
@@ -66,7 +92,7 @@ _bitcoind() {
66
92
esac
67
93
68
94
case " $cur " in
69
- -conf=* |-pid=* |-rpcsslcertificatechainfile=* |-rpcsslprivatekeyfile=* )
95
+ -conf=* |-pid=* |-loadblock= * |-wallet= * |- rpcsslcertificatechainfile=* |-rpcsslprivatekeyfile=* )
70
96
cur=" ${cur#* =} "
71
97
_filedir
72
98
return 0
@@ -103,7 +129,7 @@ _bitcoind() {
103
129
esac
104
130
}
105
131
106
- complete -F _bitcoind bitcoind
132
+ complete -F _bitcoind bitcoind bitcoin-cli
107
133
}
108
134
109
135
# Local variables:
0 commit comments