Any projects which want to use Hush code from now on will need to be licensed as GPLv3 or we will send the lawyers: https://www.softwarefreedom.org/ Notably, Komodo (KMD) is licensed as GPLv2 and is no longer compatible to receive code changes, without causing legal issues. MIT projects, such as Zcash, also cannot pull in changes from the Hush Full Node without permission from The Hush Developers, which may in some circumstances grant an MIT license on a case-by-case basis.
59 lines
1.6 KiB
Bash
59 lines
1.6 KiB
Bash
# bash programmable completion for hushd(1)
|
|
# Copyright (c) 2012-2017 The Bitcoin Core developers
|
|
# Copyright (c) 2016-2017 The Zcash developers
|
|
# Copyright (c) 2018 The Hush developers
|
|
# Distributed under the MIT software license, see the accompanying
|
|
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
|
|
_hushd() {
|
|
local cur prev words=() cword
|
|
local hushd
|
|
|
|
# save and use original argument to invoke hushd for -help
|
|
# it might not be in $PATH
|
|
hushd="$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=$($hushd -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 _hushd hushd
|
|
|
|
# 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
|