Class: HammerCLI::DefaultsCommand

Inherits:
AbstractCommand show all
Defined in:
lib/hammer_cli/defaults_commands.rb

Defined Under Namespace

Classes: AddDefaultsCommand, DeleteDefaultsCommand, ListDefaultsCommand, ProvidersDefaultsCommand

Instance Attribute Summary

Attributes inherited from AbstractCommand

#context

Instance Method Summary collapse

Methods inherited from AbstractCommand

#adapter, add_option_details_section, add_option_schema, add_sets_help, build_options, #clean_up_context, command_extensions, #exception_handler, #execute, extend_help, extend_output_definition, extend_with, family_registry, #help, help, help_extension_blocks, inherited_command_extensions, #initialize, #interactive?, option, option_builder, option_families, option_family, output, #output, output_definition, #output_definition, #parent_command, #parse, #run, use_option, validate_options, #validate_options

Methods included from Subcommand

included

Constructor Details

This class inherits a constructor from HammerCLI::AbstractCommand

Instance Method Details

#added_default_message(key, value) ⇒ Object



132
133
134
135
# File 'lib/hammer_cli/defaults_commands.rb', line 132

def added_default_message(key, value)
  print_message(_("Added %{key_val} default-option with value that will be generated from the server.") % {:key_val => key.to_s}) if value.nil?
  print_message(_("Added %{key_val} default-option with value %{val_val}.") % {:key_val => key.to_s, :val_val => value.to_s}) unless value.nil?
end

#bad_inputObject



149
150
151
# File 'lib/hammer_cli/defaults_commands.rb', line 149

def bad_input
  print_message(_("You must specify value or a provider name, can't specify both."))
end

#defaults_not_supported_by_providerObject



141
142
143
# File 'lib/hammer_cli/defaults_commands.rb', line 141

def defaults_not_supported_by_provider
  print_message(_("The param name is not supported by provider. See `hammer defaults providers` for supported params."))
end

#param_deleted(param) ⇒ Object



145
146
147
# File 'lib/hammer_cli/defaults_commands.rb', line 145

def param_deleted(param)
  print_message(_("%{param} was deleted successfully.") % {:param => param.to_s})
end

#provider_prob_message(namespace) ⇒ Object



137
138
139
# File 'lib/hammer_cli/defaults_commands.rb', line 137

def provider_prob_message(namespace)
  print_message(_("Provider %{name} was not found. See `hammer defaults providers` for available providers.") % {:name => namespace})
end

#variable_not_foundObject



153
154
155
# File 'lib/hammer_cli/defaults_commands.rb', line 153

def variable_not_found
  print_message(_("Couldn't find the requested param in %s.") % context[:defaults].send(:path))
end