From 93bdde7bd9501dceea32c3ef6359aed24c9efd3c Mon Sep 17 00:00:00 2001 From: Cezar Sa Espinola Date: Tue, 14 Sep 2021 14:33:38 -0300 Subject: [PATCH] Fix bash completion for help with spaces --- misc/bash-completion | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/misc/bash-completion b/misc/bash-completion index 67f4d8e7f..2de137e0b 100644 --- a/misc/bash-completion +++ b/misc/bash-completion @@ -3,15 +3,7 @@ # license that can be found in the LICENSE file. _tsuru() { - local tasks=`tsuru | egrep "^[ ]" | awk -F ' ' '{print $1}'` - - if [ ${#COMP_WORDS[@]} -eq 2 ]; then - local current=${COMP_WORDS[COMP_CWORD]} - if [ -n "${current}" ]; then - COMPREPLY=( $(compgen -W "$tasks" $current) ) - return - fi - fi + local tasks=`tsuru | egrep -o "^ [^A-Z]*([A-Z]|$)" | sed -e 's/^[[:space:]]*//' | sed -e 's/[[:space:]A-Z]*$//' | sed 's/ /-/g'` let last_complete=COMP_CWORD-1