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.
58 lines
1.6 KiB
Bash
58 lines
1.6 KiB
Bash
# bash programmable completion for hush-tx(1)
|
|
# Copyright (c) 2016 The Bitcoin Core developers
|
|
# Distributed under the MIT software license, see the accompanying
|
|
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
|
|
_hush_tx() {
|
|
local cur prev words=() cword
|
|
local hush_tx
|
|
|
|
# save and use original argument to invoke hush-tx for -help
|
|
# it might not be in $PATH
|
|
hush_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 hush-tx -help for options
|
|
local helpopts
|
|
helpopts=$($hush_tx -help | sed -e '/^ -/ p' -e d )
|
|
COMPREPLY=( $( compgen -W "$helpopts" -- "$cur" ) )
|
|
else
|
|
# only commands are allowed
|
|
# parse -help for commands
|
|
local helpcmds
|
|
helpcmds=$($hush_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 _hush_tx hush-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
|