public static Map<OPTCODE,String> scanConfiguration(String s[])
  {
    Map<OPTCODE,String> cmdmap = new HashMap<OPTCODE,String>();
    int i=0;
    while (i<s.length-1)
    {
      String opt = s[i];
      if (opt.startsWith("-") && (opt.length()>0))
      {
        try
        {
          opt = opt.substring(1).toLowerCase();
          OPTCODE optcode = OPTCODE.valueOf(opt);
          i++;
          cmdmap.put(optcode, s[i]);
        }
        catch (Exception ex)
        {
          printEarlyErrorAndExit(opt+" invalid: "+ex.toString());          
        }
      }
      else
      {
        printEarlyErrorAndExit(opt+" invalid");
      }
      i++;      
    }    
    if (i<s.length)
    {
      printEarlyErrorAndExit(s[i]+" invalid: no value given");
    }
    return cmdmap;
  }