Skip to content

Commit

Permalink
improving sed's regexp. Closes #3. Thanks @zaki
Browse files Browse the repository at this point in the history
  • Loading branch information
jweslley committed May 2, 2011
1 parent 9d94a86 commit ed453d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rails.bash
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#
# http://github.com/jweslley/rails_completion
#
# VERSION: 0.1.6
# VERSION: 0.1.7


RAILSCOMP_FILE=".rails_generators~"
Expand All @@ -33,7 +33,7 @@ __railscomp(){
# @param $1 Name of variable to return result to
# @param $2 Command list
__railscmd(){
any_command=$(echo $2 | sed -e 's/\s\+/|/g')
any_command=$(echo $2 | sed -e 's/[[:space:]]/|/g')
for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do
if [[ ${COMP_WORDS[i]} == @($any_command) ]]; then
eval $1="${COMP_WORDS[i]}"
Expand Down

0 comments on commit ed453d2

Please sign in to comment.