lib/compass/commands/help.rb in compass-edge-0.9.3 vs lib/compass/commands/help.rb in compass-edge-0.9.4

- old
+ new

@@ -9,20 +9,20 @@ build and maintain your stylesheets and makes it easy for you to use stylesheet libraries provided by others. To get help on a particular command please specify the command. -Available commands: - } - Compass::Commands.all.sort_by{|c| c.to_s}.each do |command| - banner << " * #{command}" - if Compass::Commands[command].respond_to? :description - banner << "\t- #{Compass::Commands[command].description(command)}" - end - banner << "\n" + + primary_commands = Compass::Commands.all.select do |c| + cmd = Compass::Commands[c] + cmd.respond_to?(:primary) && cmd.primary end + other_commands = Compass::Commands.all - primary_commands + + banner << command_list("Primary Commands:", primary_commands) + banner << command_list("Other Commands:", other_commands) banner << "\nAvailable Frameworks & Patterns:\n\n" Compass::Frameworks::ALL.each do |framework| banner << " * #{framework.name}\n" framework.template_directories.each do |pattern| @@ -35,9 +35,21 @@ end opts.banner = banner super + end + + def command_list(header, commands) + list = "#{header}\n" + commands.sort_by{|c| c.to_s}.each do |command| + list << " * #{command}" + if Compass::Commands[command].respond_to? :description + list << "\t- #{Compass::Commands[command].description(command)}" + end + list << "\n" + end + list end end class Help < Base register :help