Sha256: 7e6f5f5c2ec851fd954f94271747935765ce4017bcdc4a43e11567987331beaf

Contents?: true

Size: 696 Bytes

Versions: 26

Compression:

Stored size: 696 Bytes

Contents

# frozen_string_literal: true

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

      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
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
hammer_cli-3.13.0 lib/hammer_cli/options/predefined.rb
hammer_cli-3.12.0 lib/hammer_cli/options/predefined.rb
hammer_cli-3.10.0 lib/hammer_cli/options/predefined.rb
hammer_cli-3.9.0 lib/hammer_cli/options/predefined.rb
hammer_cli-3.8.0 lib/hammer_cli/options/predefined.rb
hammer_cli-3.7.0 lib/hammer_cli/options/predefined.rb
hammer_cli-3.5.1 lib/hammer_cli/options/predefined.rb
hammer_cli-3.6.0 lib/hammer_cli/options/predefined.rb
hammer_cli-3.5.0 lib/hammer_cli/options/predefined.rb
hammer_cli-3.4.0 lib/hammer_cli/options/predefined.rb
hammer_cli-3.3.0 lib/hammer_cli/options/predefined.rb
hammer_cli-3.2.0 lib/hammer_cli/options/predefined.rb
hammer_cli-3.1.1 lib/hammer_cli/options/predefined.rb
hammer_cli-3.0.2 lib/hammer_cli/options/predefined.rb
hammer_cli-3.1.0 lib/hammer_cli/options/predefined.rb
hammer_cli-3.0.1 lib/hammer_cli/options/predefined.rb
hammer_cli-3.0.0 lib/hammer_cli/options/predefined.rb
hammer_cli-2.5.1 lib/hammer_cli/options/predefined.rb
hammer_cli-2.5.0 lib/hammer_cli/options/predefined.rb
hammer_cli-2.3.1 lib/hammer_cli/options/predefined.rb