Add a command line option to specify the guardfile

This commit is contained in:
Doug Renn 2011-07-22 15:27:03 -06:00
parent ee8489fb83
commit e3bbdbfa42
3 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,9 @@
class Thor
module CoreExt #:nodoc:
class HashWithIndifferentAccess < ::Hash #:nodoc:
def has_key?(key)
super(convert_key(key))
end
end
end
end

View File

@ -1,3 +1,5 @@
require 'core_ext/hash_with_indifferent_access'
module Guard module Guard
autoload :UI, 'guard/ui' autoload :UI, 'guard/ui'

View File

@ -10,6 +10,8 @@ module Guard
method_option :debug, :type => :boolean, :default => false, :aliases => '-d', :banner => "Print debug messages" method_option :debug, :type => :boolean, :default => false, :aliases => '-d', :banner => "Print debug messages"
method_option :group, :type => :array, :default => [], :aliases => '-g', :banner => "Run only the passed groups" method_option :group, :type => :array, :default => [], :aliases => '-g', :banner => "Run only the passed groups"
method_option :guardfile, :type => :string, :default => './Guardfile', :aliases => '-C', :banner => "Specify a Guardfile"
desc "start", "Starts Guard" desc "start", "Starts Guard"
def start def start
::Guard.start(options) ::Guard.start(options)