alexch / rerun

Restarts an app when the filesystem changes. Uses growl and FSEventStream if on OS X.
Other
984 stars 80 forks source link

Can't pass rspec format option #97

Closed benoittgt closed 5 years ago

benoittgt commented 8 years ago

Hello

I have this in my .zshrc

alias rbrd='rerun --dir app,spec,config bin/rspec --format documentation -p "**/*.{rb,js,jbuilder,coffee,css,scss,sass,erb,html,haml,ru,yml,slim,md}"'

But I get an error

/Users/bti/.rvm/gems/ruby-2.2.2/gems/rerun-0.10.0/lib/rerun/options.rb:91:in `parse': invalid option: --format (OptionParser::InvalidOption)
    from /Users/bti/.rvm/gems/ruby-2.2.2/gems/rerun-0.10.0/bin/rerun:10:in `<top (required)>'
    from /Users/bti/.rvm/gems/ruby-2.2.2/bin/rerun:23:in `load'
    from /Users/bti/.rvm/gems/ruby-2.2.2/bin/rerun:23:in `<main>'
    from /Users/bti/.rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `eval'
    from /Users/bti/.rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `<main>'

No problem without --format documentation.

Any ideas ?

eloyesp commented 5 years ago

You should separate the command from the options using --:

alias rbrd='rerun --dir app,spec,config -p "**/*.{rb,js,jbuilder,coffee,css,scss,sass,erb,html,haml,ru,yml,slim,md}" -- bin/rspec --format documentation'

That way OptionParser can differentiate between rerun options and rspec options.

benoittgt commented 5 years ago

Thanks!