Module: ClusterChef::KnifeCommon::ClassMethods

Defined in:
lib/chef/knife/knife_common.rb

Instance Method Summary collapse

Instance Method Details

#import_banner_and_options(klass, options = {}) ⇒ Object



179
180
181
182
183
184
185
186
187
# File 'lib/chef/knife/knife_common.rb', line 179

def import_banner_and_options(klass, options={})
  options[:except] ||= []
  deps{ klass.load_deps }
  klass.options.sort.each do |name, info|
    next if options.include?(name) || options[:except].include?(name)
    option name, info
  end
  banner "knife cluster #{sub_command} CLUSTER_NAME [FACET_NAME [INDEXES]] (options)"
end

#sub_commandObject



175
176
177
# File 'lib/chef/knife/knife_common.rb', line 175

def sub_command
  self.to_s.gsub(/^.*::/, '').gsub(/^Cluster/, '').downcase
end