lib/compass/commands/help.rb in compass-edge-0.9.5.0 vs lib/compass/commands/help.rb in compass-edge-0.10.0.pre
- old
+ new
@@ -9,49 +9,24 @@
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.
-}
-
- 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
+Available 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|
- banner << " - #{framework.name}/#{pattern}"
- if description = framework.manifest(pattern).description
- banner << "\t- #{description}"
- end
- banner << "\n"
+}
+ 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"
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
class << self
@@ -76,11 +51,9 @@
def execute
if Compass::Commands.command_exists? options[:help_command]
$command = options[:help_command]
puts Compass::Commands[options[:help_command]].usage
$command = "help"
- elsif Compass::Frameworks.template_exists? options[:help_command]
- puts Compass::Frameworks.template_usage(options[:help_command])
else
raise OptionParser::ParseError, "No such command: #{options[:help_command]}"
end
end
end