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

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

#descriptionObject



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

Returns:

  • (Boolean)


52
53
54
# File 'lib/skytap/commands/help.rb', line 52

def help?
  !!global_options[:help]
end

#parametersObject



64
65
66
# File 'lib/skytap/commands/help.rb', line 64

def parameters
  spec['params']
end

#synopsisObject



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.banner_prefix} #{expected_args.keys.collect(&:upcase).join(' ') << ' '}<options> - #{self.class.short_desc}"
  end
end

#version?Boolean

Returns:

  • (Boolean)


60
61
62
# File 'lib/skytap/commands/help.rb', line 60

def version?
  !!global_options[:version]
end