Class: Compass::Commands::Help
- Inherits:
-
Base
- Object
- Base
- Compass::Commands::Help
show all
- Defined in:
- lib/compass/commands/help.rb
Instance Attribute Summary
Attributes inherited from Base
#options, #working_path
Attributes included from Actions
#logger
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#failed!, #initialize, #perform, register, #successful?
Methods included from Actions
#basename, #copy, #directory, #log_action, #process_erb, #relativize, #remove, #separate, #strip_trailing_separator, #write_file
Class Method Details
.description(command) ⇒ Object
61
62
63
|
# File 'lib/compass/commands/help.rb', line 61
def description(command)
"Get help on a compass command or extension"
end
|
.option_parser(arguments) ⇒ Object
.parse!(arguments) ⇒ Object
64
65
66
67
68
69
|
# 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 ⇒ Object
58
59
60
|
# File 'lib/compass/commands/help.rb', line 58
def usage
option_parser([]).to_s
end
|
Instance Method Details
#execute ⇒ Object
72
73
74
75
76
77
78
79
80
81
82
|
# 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
|