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



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

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



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

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

#defaults_not_supported_by_providerObject



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

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



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

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

#provider_prob_message(namespace) ⇒ Object



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

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



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

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