class Compass::Commands::Help

Public Instance Methods

description(command) click to toggle source
# File lib/compass/commands/help.rb, line 61
def description(command)
  "Get help on a compass command or extension"
end
execute() click to toggle source
# File lib/compass/commands/help.rb, line 72
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
option_parser(arguments) click to toggle source
# File lib/compass/commands/help.rb, line 53
def option_parser(arguments)
  parser = Compass::Exec::CommandOptionParser.new(arguments)
  parser.extend(Compass::Exec::GlobalOptionsParser)
  parser.extend(HelpOptionsParser)
end
parse!(arguments) click to toggle source
# File lib/compass/commands/help.rb, line 64
def parse!(arguments)
  parser = option_parser(arguments)
  parser.parse!
  parser.options[:help_command] = arguments.shift || 'help'
  parser.options
end
usage() click to toggle source
# File lib/compass/commands/help.rb, line 58
def usage
  option_parser([]).to_s
end