Class: Exec::ClusterAllocate::CustomCommandOption

Inherits:
Exec::CommandOption show all
Defined in:
lib/exec/cluster_allocate.rb

Overview

Inherited CommandOption used only by ServiceLs.

Instance Attribute Summary

Attributes inherited from Exec::CommandOption

#values

Instance Method Summary collapse

Methods inherited from Exec::CommandOption

#add_option, #get_help, #get_sorted_options, #has_argument, #initialize, #initialize_option_values, #verify

Constructor Details

This class inherits a constructor from Exec::CommandOption

Instance Method Details

#check_mandatoryObject (protected)

This method overrides the default behaviour.

Raises:



156
157
158
159
160
# File 'lib/exec/cluster_allocate.rb', line 156

def check_mandatory()
  raise Common::MissingParameter.new("-C", get_help()) if !@values["help"] && @values["cluster_name"].nil?
  raise Common::MissingParameter.new("-n or -a", get_help()) if !@values["help"] && @values["list_nodes"].nil? && !@values["all"] && !@values["cluster_name"].nil?
  raise Common::InconsistentParameter.new("can not be used together.", get_help(), "-a", "-n") if !@values["help"] && @values["all"] && !@values["list_nodes"].nil?
end

#get_bannerObject

This method overrides the default banner generating method



149
150
151
# File 'lib/exec/cluster_allocate.rb', line 149

def get_banner
  return "Usage: #@command_name -C CLUSTER_NAME -a|-n NODE_NAME"
end