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


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

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


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

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