From 922f98f9a85fcfc40d2fc07f5a3ec89243effb2f Mon Sep 17 00:00:00 2001 From: Willian Paixao Date: Wed, 29 Jun 2022 13:14:34 +0200 Subject: [PATCH 1/2] cmd/geth: fix autocompletion scripts --- build/deb/ethereum/completions/bash_autocomplete | 9 ++------- build/deb/ethereum/completions/zsh_autocomplete | 6 ++---- build/deb/ethereum/deb.install | 4 ++++ 3 files changed, 8 insertions(+), 11 deletions(-) mode change 100644 => 100755 build/deb/ethereum/completions/bash_autocomplete diff --git a/build/deb/ethereum/completions/bash_autocomplete b/build/deb/ethereum/completions/bash_autocomplete old mode 100644 new mode 100755 index f0f624183bd0..a78952793efb --- a/build/deb/ethereum/completions/bash_autocomplete +++ b/build/deb/ethereum/completions/bash_autocomplete @@ -1,8 +1,4 @@ -#! /bin/bash - -: ${PROG:=$(basename ${BASH_SOURCE})} - -_cli_bash_autocomplete() { +_geth_bash_autocomplete() { if [[ "${COMP_WORDS[0]}" != "source" ]]; then local cur opts base COMPREPLY=() @@ -17,5 +13,4 @@ _cli_bash_autocomplete() { fi } -complete -o bashdefault -o default -o nospace -F _cli_bash_autocomplete $PROG -unset PROG +complete -o bashdefault -o default -o nospace -F _geth_bash_autocomplete geth diff --git a/build/deb/ethereum/completions/zsh_autocomplete b/build/deb/ethereum/completions/zsh_autocomplete index b519666f809c..119794c532bd 100644 --- a/build/deb/ethereum/completions/zsh_autocomplete +++ b/build/deb/ethereum/completions/zsh_autocomplete @@ -1,6 +1,4 @@ -#compdef $PROG - -_cli_zsh_autocomplete() { +_geth_zsh_autocomplete() { local -a opts local cur cur=${words[-1]} @@ -17,4 +15,4 @@ _cli_zsh_autocomplete() { fi } -compdef _cli_zsh_autocomplete $PROG +compdef _geth_zsh_autocomplete geth diff --git a/build/deb/ethereum/deb.install b/build/deb/ethereum/deb.install index e7666ce5fb6b..e8496e7eade2 100644 --- a/build/deb/ethereum/deb.install +++ b/build/deb/ethereum/deb.install @@ -1 +1,5 @@ build/bin/{{.BinaryName}} usr/bin +{{- if eq .BinaryName "geth" }} +build/deb/ethereum/completions/bash_autocomplete /etc/bash_completion.d/geth +build/deb/ethereum/completions/zsh_autocomplete /usr/share/zsh/vendor-completions/_geth +{{end -}} From 0871137ba2de98a151e6919d5ed4f2000aa3b884 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Wed, 29 Jun 2022 19:41:13 +0200 Subject: [PATCH 2/2] Update deb.install --- build/deb/ethereum/deb.install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/deb/ethereum/deb.install b/build/deb/ethereum/deb.install index e8496e7eade2..019bd0f4bb3f 100644 --- a/build/deb/ethereum/deb.install +++ b/build/deb/ethereum/deb.install @@ -1,5 +1,5 @@ build/bin/{{.BinaryName}} usr/bin {{- if eq .BinaryName "geth" }} -build/deb/ethereum/completions/bash_autocomplete /etc/bash_completion.d/geth -build/deb/ethereum/completions/zsh_autocomplete /usr/share/zsh/vendor-completions/_geth +build/deb/ethereum/completions/bash_autocomplete etc/bash_completion.d/geth +build/deb/ethereum/completions/zsh_autocomplete usr/share/zsh/vendor-completions/_geth {{end -}}