private static String[] tidyOptionsArray(String[] options){
  if (options == null || options.length < 1) {
    return options;
  }
  Set<String> parsedOptions=new HashSet<String>();
  for (  String optionsArrayItem : options) {
    String[] optionsArrayItems=optionsArrayItem.split("[,\\s+]+");
    for (    String option : optionsArrayItems) {
      if (option != null && !option.equals("")) {
        parsedOptions.add(option);
      }
    }
  }
  return parsedOptions.toArray(new String[parsedOptions.size()]);
}

private static String [ ] tidyOptionsArray ( String [ ] options ) { if ( options == null || options . length < 1 ) { return options ; } Set < String > parsedOptions = new HashSet < String > ( ) ; for ( String optionsArrayItem : options ) { String [ ] optionsArrayItems = optionsArrayItem . split ( "[,\\s+]+" ) ; for ( String option : optionsArrayItems ) { if ( option != null && ! option . equals ( "" ) ) { parsedOptions . add ( option ) ; } } } return parsedOptions . toArray ( new String [ parsedOptions . size ( ) ] ) ; }
tidy an array of options for a command line option that takes multiple values . for example { " pfam , " , " gene3d , smart " , " , " , " , test " } becomes { " pfam " , " gene3d " , " smart " , " test " } . the validity of the options are not checked here .
