Skip to content

Commit

Permalink
Merge pull request #3273 from lspitzner/patch-3
Browse files Browse the repository at this point in the history
Fix bash-completion after "--"
  • Loading branch information
23Skidoo committed Apr 2, 2016
2 parents 8b33d3a + 9018c27 commit f5526eb
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cabal-install/bash-completion/cabal
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,16 @@ _cabal_subcommands()

__cabal_has_doubledash ()
{
for w in "${COMP_WORDS[@]}"
do
if [ "--" == "$w" ]; then
local c=1
# Ignore the last word, because it is replaced anyways.
# This allows expansion for flags on "cabal foo --",
# but does not try to complete after "cabal foo -- ".
local n=$((${#COMP_WORDS[@]} - 1))
while [ $c -lt $n ]; do
if [ "--" = "${COMP_WORDS[c]}" ]; then
return 0
fi
((c++))
done
return 1
}
Expand Down

0 comments on commit f5526eb

Please sign in to comment.