public static String [] partitionOptions(String [] options) {

    for (int i = 0; i < options.length; i++) {
      if (options[i].equals("--")) {
	// ensure it follows by a -E option
	int j = i;
	while ((j < options.length) && !(options[j].equals("-E"))) {
	  j++;
	}
        /*	if (j >= options.length) {
	  return new String[0];
          } */
	options[i++] = "";
	String [] result = new String [options.length - i];
	j = i;
	while ((j < options.length) && !(options[j].equals("-E"))) {
	  result[j - i] = options[j];
	  options[j] = "";
	  j++;
	}
	while(j < options.length) {
	  result[j - i] = "";
	  j++;
	}		 
	return result;
      }
    }
    return new String [0];
  }