Skip to content

Commit

Permalink
Merge pull request #2537 from zadarnowski/master
Browse files Browse the repository at this point in the history
Fixed bash completion for sandbox subcommands
  • Loading branch information
23Skidoo committed Apr 15, 2015
2 parents 641e854 + 356e5ca commit fdf274d
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions cabal-install/bash-completion/cabal
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,8 @@ _cabal_subcommands()
case "$word" in
sandbox)
# Get list of "cabal sandbox" subcommands from its help message.
#
# Following command short-circuits if it reaches flags section.
# This is to prevent any problems that might arise from unfortunate
# word combinations in flag descriptions. Usage section is parsed
# using simple regexp and "sandbox" subcommand is printed for each
# successful substitution.
"$1" help sandbox |
sed -rn '/Flags/q;s/^.* cabal sandbox *([^ ]*).*/\1/;t p;b;: p;p'
sed -n '1,/^Subcommands:$/d;/^Flags for sandbox:$/,$d;/^ /d;s/^\(.*\):/\1/p'
break # Terminate for loop.
;;
esac
Expand Down

0 comments on commit fdf274d

Please sign in to comment.