private static OutputFormat whichOutputFormat ( CommandLine line ) throws ParseException { if ( ! line . hasOption ( ' ' ) ) { return OutputFormat . CSV ; } try { return OutputFormat . valueOf ( line . getOptionValue ( ' ' ) ) ; } catch ( IllegalArgumentException e ) { throw new ParseException ( String . format ( "format %s is illegal. Available formats: %s" , line . getOptionValue ( ' ' ) , Utils . join ( "," , OutputFormat . formatNames ( ) ) ) ) ; } }
CommandLine parsing methods