Module: Ironfan::KnifeCommon::ClassMethods

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

Instance Method Summary collapse

Instance Method Details

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



281
282
283
284
285
286
287
288
289
290
# File 'lib/chef/knife/ironfan_knife_common.rb', line 281

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
  options[:description] ||= "#{sub_command} all servers described by given cluster slice"
  banner "knife cluster #{"%-11s" % sub_command} CLUSTER[-FACET[-INDEXES]] (options) - #{options[:description]}"
end

#sub_commandObject



277
278
279
# File 'lib/chef/knife/ironfan_knife_common.rb', line 277

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