Sha256: 989c37bf5304f84b70fa8642e78890c8ff34cce5fd732ee5324a8a99b673c6bb

Contents?: true

Size: 948 Bytes

Versions: 9

Compression:

Stored size: 948 Bytes

Contents

module HammerCLIForemanPuppet
  module CommandExtensions
    class PuppetEnvironment < HammerCLI::CommandExtensions
      # FIXME: Temp workaround for option builders in case of multiple plugins
      # extensions of the same command
      option_family do
        parent '--puppet-environment-id', 'PUPPET_ENVIRONMENT_ID', _('ID of associated Puppet environment'),
               format: HammerCLI::Options::Normalizers::Number.new,
               attribute_name: :option_environment_id
        child '--puppet-environment', 'PUPPET_ENVIRONMENT_NAME', _('Name of associated Puppet environment'),
              attribute_name: :option_environment_name
      end

      option_sources do |sources, command|
        sources.find_by_name('IdResolution').insert_relative(
          :after,
          'IdParams',
          HammerCLIForemanPuppet::OptionSources::PuppetEnvironmentParams.new(command)
        )
        sources
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
hammer_cli_foreman_puppet-0.1.1 lib/hammer_cli_foreman_puppet/command_extensions/environment.rb
hammer_cli_foreman_puppet-0.1.0 lib/hammer_cli_foreman_puppet/command_extensions/environment.rb
hammer_cli_foreman_puppet-0.0.7 lib/hammer_cli_foreman_puppet/command_extensions/environment.rb
hammer_cli_foreman_puppet-0.0.6 lib/hammer_cli_foreman_puppet/command_extensions/environment.rb
hammer_cli_foreman_puppet-0.0.5 lib/hammer_cli_foreman_puppet/command_extensions/environment.rb
hammer_cli_foreman_puppet-0.0.4 lib/hammer_cli_foreman_puppet/command_extensions/environment.rb
hammer_cli_foreman_puppet-0.0.3 lib/hammer_cli_foreman_puppet/command_extensions/environment.rb
hammer_cli_foreman_puppet-0.0.2 lib/hammer_cli_foreman_puppet/command_extensions/environment.rb
hammer_cli_foreman_puppet-0.0.1 lib/hammer_cli_foreman_puppet/command_extensions/environment.rb