Skip to content

Commit

Permalink
Fix bash completion for help with spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
cezarsa committed Sep 14, 2021
1 parent eca3769 commit 93bdde7
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions misc/bash-completion
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 93bdde7

Please sign in to comment.