def configure(aConfig,aCmdOptions = nil,aOptions = nil)
      config_to_read = {}
			if aConfig.is_a?(String)
				aConfig = MiscUtils.canonize_path(aConfig)
				logger.info "Job file: #{aConfig}"
				op = {:basepath => File.dirname(aConfig)}
				xmlString = MiscUtils.string_from_file(aConfig)
				xmlString = XmlUtils2.clean_data(xmlString)
				xml = XmlUtils.get_xml_root(xmlString)
				return configure(xml,aCmdOptions,op)
			end

			if @config
				config_as_hash = nil
				case aConfig
					when nil then ;	# do nothing
					when Hash,::ConfigClass then config_as_hash = aConfig
					when REXML::Element then
						config_as_hash = XmlUtils.read_simple_items(aConfig,'/Yore/SimpleItems')
						config.xmlRoot = aConfig 	# overwriting previous! perhaps should merge
					else
						raise StandardError.new('unsupported type')
				end
				config_as_hash.each{|n,v| config_to_read[n.to_sym] = v} if config_as_hash					# merge given new values
			else
				@config = ConfigXmlClass.new(DEFAULT_CONFIG,aConfig)
			end		
      aCmdOptions.each{|k,v| config_to_read[k.to_sym] = v} if aCmdOptions		# merge command options
      config_to_read.merge!(aOptions) if aOptions														# merge options
			config.read(config_to_read)
			config[:basepath] = MiscUtils.canonize_path(config[:basepath],Dir.pwd)

			expand_app_option()
    end
def configure(aConfig,aCmdOptions = nil,aOptions = nil)
      config_to_read = {}
			if aConfig.is_a?(String)
				aConfig = MiscUtils.canonize_path(aConfig)
				logger.info "Job file: #{aConfig}"
				op = {:basepath => File.dirname(aConfig)}
				xmlString = MiscUtils.string_from_file(aConfig)
				xmlString = XmlUtils2.clean_data(xmlString)
				xml = XmlUtils.get_xml_root(xmlString)
				return configure(xml,aCmdOptions,op)
			end

			if @config
				config_as_hash = nil
				case aConfig
					when nil then ;	# do nothing
					when Hash,::ConfigClass then config_as_hash = aConfig
					when REXML::Element then
						config_as_hash = XmlUtils.read_simple_items(aConfig,'/Yore/SimpleItems')
						config.xmlRoot = aConfig 	# overwriting previous! perhaps should merge
					else
						raise StandardError.new('unsupported type')
				end
				config_as_hash.each{|n,v| config_to_read[n.to_sym] = v} if config_as_hash					# merge given new values
			else
				@config = ConfigXmlClass.new(DEFAULT_CONFIG,aConfig)
			end		
      aCmdOptions.each{|k,v| config_to_read[k.to_sym] = v} if aCmdOptions		# merge command options
      config_to_read.merge!(aOptions) if aOptions														# merge options
			config.read(config_to_read)
			config[:basepath] = MiscUtils.canonize_path(config[:basepath],Dir.pwd)

			expand_app_option()
    end
read the config however its given and return a hash with values in their correct type, and either valid or nil
 keys must be :symbols for aOptions. aConfig and aCmdOptions can be strings