Sha256: 859e91e4176e6cacafea215daaedd5784208ce36f8707103cf510549ad11dc83

Contents?: true

Size: 1.14 KB

Versions: 12

Compression:

Stored size: 1.14 KB

Contents

module HammerCLIForeman
  module CommandExtensions
    class PuppetEnvironments < HammerCLI::CommandExtensions
      # Remove when support of --environments options is ended.
      option_family(
        aliased_resource: 'environment',
        description: _('Puppet environments'),
        deprecation: _("Use %s instead") % '--puppet-environment[s|-ids]',
        deprecated: { '--environments' => _("Use %s instead") % '--puppet-environment[s|-ids]',
                      '--environment-ids' => _("Use %s instead") % '--puppet-environment[s|-ids]' }
      ) do
        parent '--environment-ids', 'ENVIRONMENT_IDS', _('Environment IDs'),
               format: HammerCLI::Options::Normalizers::List.new,
               attribute_name: :option_environment_ids
        child '--environments', 'ENVIRONMENT_NAMES', _(''),
              attribute_name: :option_environment_names
      end

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

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
hammer_cli_foreman-2.5.2 lib/hammer_cli_foreman/command_extensions/puppet_environments.rb
hammer_cli_foreman-2.5.1 lib/hammer_cli_foreman/command_extensions/puppet_environments.rb
hammer_cli_foreman-2.5.0 lib/hammer_cli_foreman/command_extensions/puppet_environments.rb
hammer_cli_foreman-2.3.2 lib/hammer_cli_foreman/command_extensions/puppet_environments.rb
hammer_cli_foreman-2.4.0 lib/hammer_cli_foreman/command_extensions/puppet_environments.rb
hammer_cli_foreman-2.3.1 lib/hammer_cli_foreman/command_extensions/puppet_environments.rb
hammer_cli_foreman-2.3.0 lib/hammer_cli_foreman/command_extensions/puppet_environments.rb
hammer_cli_foreman-2.1.3 lib/hammer_cli_foreman/command_extensions/puppet_environments.rb
hammer_cli_foreman-2.2.0 lib/hammer_cli_foreman/command_extensions/puppet_environments.rb
hammer_cli_foreman-2.1.2 lib/hammer_cli_foreman/command_extensions/puppet_environments.rb
hammer_cli_foreman-2.1.1 lib/hammer_cli_foreman/command_extensions/puppet_environments.rb
hammer_cli_foreman-2.1.0 lib/hammer_cli_foreman/command_extensions/puppet_environments.rb