Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: fix auto-completion scripts and include them in .deb package #25195

Merged
merged 2 commits into from Jun 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 2 additions & 7 deletions build/deb/ethereum/completions/bash_autocomplete 100644 → 100755
@@ -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=()
Expand All @@ -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
6 changes: 2 additions & 4 deletions 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]}
Expand All @@ -17,4 +15,4 @@ _cli_zsh_autocomplete() {
fi
}

compdef _cli_zsh_autocomplete $PROG
compdef _geth_zsh_autocomplete geth
4 changes: 4 additions & 0 deletions 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 -}}