Class: Travis::CLI::Help
Constant Summary
Constants inherited from Command
Command::DAY, Command::HOUR, Command::MINUTE, Command::WEEK
Constants included from Tools::Assets
Instance Attribute Summary
Attributes inherited from Command
#arguments, #config, #debug, #force_interactive, #formatter, #input, #output
Instance Method Summary collapse
Methods inherited from Command
abstract, abstract?, #check_completion, #check_ruby, #check_version, command_name, #command_name, #debug?, description, #execute, #help, #info, #initialize, #last_check, #on_signal, #parse, #say, #setup, skip, subcommands, #terminal, #time, #usage, #usage_for, #write_to
Methods included from Tools::Assets
Methods included from Parser
Constructor Details
This class inherits a constructor from Travis::CLI::Command
Instance Method Details
#commands ⇒ Object
18 19 20 |
# File 'lib/travis/cli/help.rb', line 18 def commands CLI.commands.sort_by { |c| c.command_name } end |
#run(command = nil) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/travis/cli/help.rb', line 8 def run(command = nil) if command say CLI.command(command).new.help else say "Usage: travis COMMAND ...\n\nAvailable commands:\n\n" commands.each { |c| say "\t#{color(c.command_name, :command).ljust(20)} #{color(c.description, :info)}" } say "\nrun `#$0 help COMMAND` for more infos" end end |