Commit 015795a5 authored by Emeric Verschuur's avatar Emeric Verschuur

[FIX/bashcomp] Fix number calculation in the _citbx4gitlab_compgen function

parent cad5a4a1
# Cangelog
## HEAD (next release)
* [FIX/bashcomp] Fix number calculation in the _citbx4gitlab_compgen function
## 3.0.1
* [FIX] regression: CITBX_TOOL_NAME not defined when tools/gitlab-ci/run.sh is called directly
......
......@@ -20,7 +20,7 @@ _citbx4gitlab_compgen() {
_init_completion -s || return
cur=${COMP_WORDS[COMP_CWORD]}
cmd=$(eval echo "${COMP_WORDS[1]}")
if [ "0$COMP_CWORD" -eq 1 ]; then
if [ $COMP_CWORD -eq 1 ]; then
result=$(compgen -W "$(CITBX_BASHCOMP=commands citbx4gitlab 2>/dev/null || true)" -- "$cur")
else
case "$cur" in
......@@ -31,7 +31,7 @@ _citbx4gitlab_compgen() {
result=$(compgen -W "$(CITBX_BASHCOMP=longopts citbx4gitlab "$cmd" 2>/dev/null || true)" -- "$cur")
;;
*)
prev=${COMP_WORDS[$((0$COMP_CWORD - 1))]}
prev=${COMP_WORDS[$(($COMP_CWORD - 1))]}
case "$prev" in
-*)
result=$(compgen -W "$(CITBX_BASHCOMP=$prev citbx4gitlab "$cmd" 2>/dev/null || true)" -- "$cur")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment