Class: EYCli::Command::Help
Defined Under Namespace
Classes: HelpParser
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #help ⇒ Object
- #invoke ⇒ Object
- #options_parser ⇒ Object
- #print_command_help(name) ⇒ Object
- #print_commands ⇒ Object
Methods inherited from Base
Instance Method Details
#help ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/ey_cli/commands/help.rb', line 33 def help "\nUsage: ey_cli command [args]\nTry `ey_cli help commands' to list the available commands.\nTry `ey_cli help [command]' for more information about a command.\n\nCurrently available commands:\n\n General info\n accounts List the accounts associated to a user.\n console Start an interactive session to use ey_cli.\n help Show commands information.\n\n Applications\n apps List the applications associated to a user.\n create_app Create a new application. It takes the information from the current directory.\n show Show information and status of an application.\n\n Environments\n create_env Create a new environment for an application.\n deploy Run a deploy for an application.\n" end |
#invoke ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/ey_cli/commands/help.rb', line 5 def invoke name = [:command_name] || 'help' if name == 'commands' print_commands else print_command_help(name) end end |
#options_parser ⇒ Object
29 30 31 |
# File 'lib/ey_cli/commands/help.rb', line 29 def HelpParser.new end |
#print_command_help(name) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/ey_cli/commands/help.rb', line 14 def print_command_help(name) command = EYCli.command_manager[name] if command_help = (command and command.help) EYCli.term.say(command_help) else EYCli.term.say("help not available for command: '#{name}'") end end |
#print_commands ⇒ Object
23 24 25 26 27 |
# File 'lib/ey_cli/commands/help.rb', line 23 def print_commands EYCli.term.say("available commands:") command_names = EYCli.command_manager.commands.keys.map {|name| "- #{name}"}.sort EYCli.term.say("\t" + command_names.join("\n\t")) end |