private static void output(CommandLine cmdLine,KeywordCollection bestKeywords) throws KeywordOptimizerException {
  for (  String mode : cmdLine.getOptionValues("o")) {
    OutputMode outputMode=OutputMode.valueOf(mode);
switch (outputMode) {
case CONSOLE:
      outputConsole(bestKeywords);
    break;
case CSV:
  outputCsv(cmdLine,bestKeywords);
break;
default :
throw new KeywordOptimizerException("Parameter -o is required");
}
}
}

private static void output ( CommandLine cmdLine , KeywordCollection bestKeywords ) throws KeywordOptimizerException { for ( String mode : cmdLine . getOptionValues ( "o" ) ) { OutputMode outputMode = OutputMode . valueOf ( mode ) ; switch ( outputMode ) { case CONSOLE : outputConsole ( bestKeywords ) ; break ; case CSV : outputCsv ( cmdLine , bestKeywords ) ; break ; default : throw new KeywordOptimizerException ( "Parameter -o is required" ) ; } } }
outputs the results based on the command line parameters .
