Module: Skytap::Commands::Help
- Included in:
- Base
- Defined in:
- lib/skytap/commands/help.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
- #description ⇒ Object
- #help! ⇒ Object
- #help? ⇒ Boolean
- #parameters ⇒ Object
- #synopsis ⇒ Object
- #version? ⇒ Boolean
Class Method Details
.included(base) ⇒ Object
72 73 74 75 76 77 78 79 |
# File 'lib/skytap/commands/help.rb', line 72 def self.included(base) base.extend(ClassMethods) # Indicates whether this class is only a container for subcommands. base.class_attribute :container, :spec, :plugin base.container = false base.plugin = false base.spec = {} end |
Instance Method Details
#description ⇒ Object
68 69 70 |
# File 'lib/skytap/commands/help.rb', line 68 def description self.class.description end |
#help! ⇒ Object
56 57 58 |
# File 'lib/skytap/commands/help.rb', line 56 def help! puts Skytap::Templates::Help.render(self) end |
#help? ⇒ Boolean
52 53 54 |
# File 'lib/skytap/commands/help.rb', line 52 def help? !![:help] end |
#parameters ⇒ Object
64 65 66 |
# File 'lib/skytap/commands/help.rb', line 64 def parameters spec['params'] end |
#synopsis ⇒ Object
43 44 45 46 47 48 49 50 |
# File 'lib/skytap/commands/help.rb', line 43 def synopsis if self.container command_name = self.class.command_name "skytap #{command_name + ' ' if command_name}<subcommand> <options>" else "#{self.class.} #{expected_args.keys.collect(&:upcase).join(' ') << ' '}<options> - #{self.class.short_desc}" end end |
#version? ⇒ Boolean
60 61 62 |
# File 'lib/skytap/commands/help.rb', line 60 def version? !![:version] end |