Class: HammerCLI::DefaultsCommand::DeleteDefaultsCommand

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

Instance Attribute Summary

Attributes inherited from AbstractCommand

#context

Instance Method Summary collapse

Methods inherited from HammerCLI::DefaultsCommand

#added_default_message, #bad_input, #defaults_not_supported_by_provider, #param_deleted, #provider_prob_message, #variable_not_found

Methods inherited from AbstractCommand

#adapter, add_option_details_section, add_option_schema, add_sets_help, build_options, #clean_up_context, command_extensions, #exception_handler, 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

#executeObject



88
89
90
91
92
93
94
95
96
# File 'lib/hammer_cli/defaults_commands.rb', line 88

def execute
  if context[:defaults] && context[:defaults].defaults_set?(option_param_name)
    context[:defaults].delete_default_from_conf(option_param_name.to_sym)
    param_deleted(option_param_name)
  else
    variable_not_found
  end
  HammerCLI::EX_OK
end