def option_parser( optlist )
      return if optlist.size == 0
      deletelist = []
      # search option in argument list.
      ARGV.each_with_index do |opt,i|
	o = getopt( opt )
	if o[:n] != '' and o[:n] != 'h' and o[:n] != 'help'
	  o[:i] = i
	  # Search in application list
	  result = option_search( o, optlist )
	  if result != nil then
	    deletelist << opt
	    result = option_set( o, optlist[result] )
	    deletelist << result if result != ''
	  end
	end
      end
      # delete option from ARGV.
      deletelist.each do |n|
	ARGV.delete( n )
      end
    end
def option_parser( optlist )
      return if optlist.size == 0
      deletelist = []
      # search option in argument list.
      ARGV.each_with_index do |opt,i|
	o = getopt( opt )
	if o[:n] != '' and o[:n] != 'h' and o[:n] != 'help'
	  o[:i] = i
	  # Search in application list
	  result = option_search( o, optlist )
	  if result != nil then
	    deletelist << opt
	    result = option_set( o, optlist[result] )
	    deletelist << result if result != ''
	  end
	end
      end
      # delete option from ARGV.
      deletelist.each do |n|
	ARGV.delete( n )
      end
    end
Parsing options in command line.