module Chef::Knife::Core::MultiAttributeReturnOption

Allows includer knife commands to return multiple attributes @brief knife node show NAME -a ATTR1 -a ATTR2

Public Class Methods

included(includer) click to toggle source

@private

# File lib/chef/knife/core/generic_presenter.rb, line 29
def self.included(includer)
  includer.class_eval do
    option :field_separator,
      short: "-S SEPARATOR",
      long: "--field-separator SEPARATOR",
      description: "Character separator used to delineate nesting in --attribute filters (default \".\")"

    option :attribute,
      short: "-a ATTR1 [-a ATTR2]",
      long: "--attribute ATTR1 [--attribute ATTR2] ",
      description: "Show one or more attributes",
      proc: Proc.new { |arg, accumulator|
        accumulator ||= []
        accumulator << arg
        accumulator
      }
  end
end