Changeset View
Changeset View
Standalone View
Standalone View
contrib/bitcoind.bash-completion
Show All 24 Lines | case "$cur" in | ||||
_filedir -d | _filedir -d | ||||
return 0 | return 0 | ||||
;; | ;; | ||||
-*=*) # prevent nonsense completions | -*=*) # prevent nonsense completions | ||||
return 0 | return 0 | ||||
;; | ;; | ||||
*) | *) | ||||
# only parse -help if senseful | # only parse -help if sensible | ||||
if [[ -z "$cur" || "$cur" =~ ^- ]]; then | if [[ -z "$cur" || "$cur" =~ ^- ]]; then | ||||
local helpopts | local helpopts | ||||
helpopts=$($bitcoind -help 2>&1 | awk '$1 ~ /^-/ { sub(/=.*/, "="); print $1 }' ) | helpopts=$($bitcoind -help 2>&1 | awk '$1 ~ /^-/ { sub(/=.*/, "="); print $1 }' ) | ||||
COMPREPLY=( $( compgen -W "$helpopts" -- "$cur" ) ) | COMPREPLY=( $( compgen -W "$helpopts" -- "$cur" ) ) | ||||
fi | fi | ||||
# Prevent space if an argument is desired | # Prevent space if an argument is desired | ||||
if [[ $COMPREPLY == *= ]]; then | if [[ $COMPREPLY == *= ]]; then | ||||
Show All 15 Lines |