enable --help option for all subcommands

This commit is contained in:
Andre Arko 2011-07-26 21:26:25 -07:00
parent 5b8da9d8b8
commit 4e0c7a0142

View file

@ -8,9 +8,11 @@ module Middleman
check_unknown_options! check_unknown_options!
default_task :server default_task :server
class_option "help", :type => :boolean, :default => false, :aliases => "-h"
def initialize(*) def initialize(*)
config_check
super super
config_check
help_check
end end
desc "init NAME", "Create new Middleman project directory NAME" desc "init NAME", "Create new Middleman project directory NAME"
@ -65,5 +67,10 @@ module Middleman
end end
end end
def help_check
help self.class.send(:retrieve_task_name, ARGV.dup)
exit 0
end
end end
end end