Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/contrib/completion/bash/devtools.in
diff options
context:
space:
mode:
authorChristian Heusel <christian@heusel.eu>2024-04-23 14:57:55 +0200
committerLevente Polyak <anthraxx@archlinux.org>2024-04-24 22:55:18 +0200
commitdced77d23de2a9b00faed40350d229aaaffaa4b2 (patch)
tree566a382484bfb3a6be417b012da05d985ca23f09 /contrib/completion/bash/devtools.in
parent5780ba0e380d619c7e6632edbf6e357dce73289f (diff)
fix(completion): fix erroneous completion variables
The architecture definition of the variable was using invalid bash syntax and was previously unused: $ _binary_arch=${DEVTOOLS_VALID_ARCHES[*]:0:-1} bash: -1: substring expression < 0 We therefore fix the definition of the variable and use it for the autocompletion of the offload-build command. Furthermore fix wrongly named architecture variables that have been missed from previous refactoring. Fixes #222 Component: completion Fixes: f961e2e ("completion: implemented structured declarative bash completions") Fixes: 4173e0a ("chore: refactor variable names in valid-{tags,repos}.sh") Signed-off-by: Christian Heusel <christian@heusel.eu> Co-authored-by: Levente Polyak <anthraxx@archlinux.org>
Diffstat (limited to 'contrib/completion/bash/devtools.in')
-rw-r--r--contrib/completion/bash/devtools.in10
1 files changed, 7 insertions, 3 deletions
diff --git a/contrib/completion/bash/devtools.in b/contrib/completion/bash/devtools.in
index 6b88203..2d5b7bf 100644
--- a/contrib/completion/bash/devtools.in
+++ b/contrib/completion/bash/devtools.in
@@ -14,7 +14,6 @@ source "${_DEVTOOLS_LIBRARY_DIR}"/lib/valid-inspect.sh
# shellcheck source=src/lib/valid-search.sh
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/valid-search.sh
-_binary_arch=${DEVTOOLS_VALID_ARCHES[*]:0:-1}
_colors=(never always auto)
@@ -128,7 +127,7 @@ _offload_build_args=(
)
_offload_build_args__repo_opts() { _devtools_completions_build_repo; }
_offload_build_args_r_opts() { _offload_build_args__repo_opts; }
-_offload_build_args__arch_opts() { _devtools_completions_arch; }
+_offload_build_args__arch_opts() { _devtools_completions_binary_arch; }
_offload_build_args_a_opts() { _offload_build_args__arch_opts; }
_offload_build_args__server_opts() { :; }
_offload_build_args_s_opts() { _offload_build_args__server_opts; }
@@ -196,7 +195,7 @@ _pkgctl_build_args=(
-h --help
)
-_pkgctl_build_args__arch_opts() { _devtools_completions_arch; }
+_pkgctl_build_args__arch_opts() { _devtools_completions_binary_arch; }
_pkgctl_build_args__repo_opts() { _devtools_completions_repo; }
_pkgctl_build_args__worker_opts() { :; }
_pkgctl_build_args_w_opts() { _pkgctl_build_args__worker_opts; }
@@ -244,6 +243,8 @@ _pkgctl_db_remove_args=(
-a --arch
-h --help
)
+_pkgctl_db_remove_args__arch_opts() { _devtools_completions_binary_arch; }
+_pkgctl_db_remove_args_a_opts() { _pkgctl_db_remove_args__arch_opts; }
_pkgctl_db_remove_opts() {
local subcommand args
subcommand=(db remove)
@@ -434,6 +435,9 @@ _devtools_completions_color() {
_devtools_completions_arch() {
mapfile -t COMPREPLY < <(compgen -W "${DEVTOOLS_VALID_ARCHES[*]}" -- "$cur")
}
+_devtools_completions_binary_arch() {
+ mapfile -t COMPREPLY < <(compgen -W "${DEVTOOLS_VALID_BINARY_ARCHES[*]}" -- "$cur")
+}
_devtools_completions_repo() {
local optional=${1:-}
mapfile -t COMPREPLY < <(compgen -W "${optional} ${DEVTOOLS_VALID_REPOS[*]}" -- "$cur")