Module: HammerCLI::Options::Predefined

Defined in:
lib/hammer_cli/options/predefined.rb

Overview

Contains predefined by HammerCLI options for commands

Constant Summary collapse

OPTIONS =
{
  fields: [['--fields'], 'FIELDS',
           _('Show specified fields or predefined field sets only. (See below)'),
           format: HammerCLI::Options::Normalizers::List.new,
           context_target: :fields]
}.freeze

Class Method Summary collapse

Class Method Details

.use(option_name, command_class) ⇒ Object



14
15
16
17
18
19
# File 'lib/hammer_cli/options/predefined.rb', line 14

def self.use(option_name, command_class)
  unless OPTIONS.key?(option_name)
    raise ArgumentError, _('There is no such predefined option %s.') % option_name
  end
  command_class.send(:option, *OPTIONS[option_name])
end