contrib/lightning-cli.bash-completion: fix for new simpler help format.

Plus, we don't need awk *and* sed for this!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2018-01-29 11:00:15 +10:30 committed by Christian Decker
parent 7d18ef9ecf
commit 7fd5808803

View File

@ -31,7 +31,7 @@ _lightning_cli() {
# get the regular commands
if [[ -z "$cur" || "$cur" =~ ^[a-z] ]]; then
helpopts=$($lightning_cli help 2>/dev/null | awk '{print $4}' | sed 's@[,"]@@g')
helpopts=$($lightning_cli -H help 2>/dev/null | sed -n 's/^command=//p')
fi
COMPREPLY=( $( compgen -W "$helpopts $globalcmds" -X "*," -- "$cur" ) )