Skip to content

Commit ea0bf08

Browse files
willianpaixaofjl
andauthored
build: fix auto-completion scripts and include them in .deb package (#25195)
Co-authored-by: Felix Lange <[email protected]>
1 parent d12b1a9 commit ea0bf08

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

build/deb/ethereum/completions/bash_autocomplete

100644100755
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
#! /bin/bash
2-
3-
: ${PROG:=$(basename ${BASH_SOURCE})}
4-
5-
_cli_bash_autocomplete() {
1+
_geth_bash_autocomplete() {
62
if [[ "${COMP_WORDS[0]}" != "source" ]]; then
73
local cur opts base
84
COMPREPLY=()
@@ -17,5 +13,4 @@ _cli_bash_autocomplete() {
1713
fi
1814
}
1915

20-
complete -o bashdefault -o default -o nospace -F _cli_bash_autocomplete $PROG
21-
unset PROG
16+
complete -o bashdefault -o default -o nospace -F _geth_bash_autocomplete geth

build/deb/ethereum/completions/zsh_autocomplete

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#compdef $PROG
2-
3-
_cli_zsh_autocomplete() {
1+
_geth_zsh_autocomplete() {
42
local -a opts
53
local cur
64
cur=${words[-1]}
@@ -17,4 +15,4 @@ _cli_zsh_autocomplete() {
1715
fi
1816
}
1917

20-
compdef _cli_zsh_autocomplete $PROG
18+
compdef _geth_zsh_autocomplete geth

build/deb/ethereum/deb.install

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
build/bin/{{.BinaryName}} usr/bin
2+
{{- if eq .BinaryName "geth" }}
3+
build/deb/ethereum/completions/bash_autocomplete etc/bash_completion.d/geth
4+
build/deb/ethereum/completions/zsh_autocomplete usr/share/zsh/vendor-completions/_geth
5+
{{end -}}

0 commit comments

Comments
 (0)