From 01cbc9cc6c0ff2ec874ed7ac5fd2a0c329d1d57d Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Tue, 31 Aug 2010 21:48:25 -0700 Subject: [PATCH] Print out the new style help with -h and --help instead of the old-style help. --- lib/compass/exec/helpers.rb | 6 ++++-- lib/compass/exec/switch_ui.rb | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/compass/exec/helpers.rb b/lib/compass/exec/helpers.rb index 11d31dd6..f1e8db1a 100644 --- a/lib/compass/exec/helpers.rb +++ b/lib/compass/exec/helpers.rb @@ -5,8 +5,10 @@ module Compass::Exec if Compass::Commands.command_exists? arguments.first SubCommandUI else - Compass::Logger.new.red do - Haml::Util.haml_warn "WARNING: This interface is deprecated. Please use the new subcommand interface.\nSee `compass help` for more information.\n" + unless arguments.include?("-h") || arguments.include?("--help") + Compass::Logger.new.red do + Haml::Util.haml_warn "WARNING: This interface is deprecated. Please use the new subcommand interface.\nSee `compass help` for more information.\n" + end end SwitchUI end diff --git a/lib/compass/exec/switch_ui.rb b/lib/compass/exec/switch_ui.rb index 77552d45..a17a65ee 100644 --- a/lib/compass/exec/switch_ui.rb +++ b/lib/compass/exec/switch_ui.rb @@ -89,6 +89,11 @@ END self.options[:pattern] = pattern end + opts.on('-h', '--help') do + self.options[:command] = :help + self.options[:help_command] = :help + end + opts.on('--write-configuration', "Write the current configuration to the configuration file.") do self.options[:command] = :write_configuration end