private static CommandLine parseCommandLine()

in markbook/src/main/java/org/apache/hadoop/gateway/markbook/MarkBook.java [200:214]


  private static CommandLine parseCommandLine( String[] args ) throws ParseException {
    Options options = createOptions();
    CommandLineParser parser = new BasicParser();
    CommandLine command = parser.parse( options, args );
    if( command.hasOption( "help" ) ) {
      printHelp( options );
    }
    if( !command.hasOption( "input" ) || command.getOptionValues( "input" ).length == 0 ) {
      printHelp( options );
    }
    if( !command.hasOption( "output" ) || command.getOptionValues( "output" ).length != 1 ) {
      printHelp( options );
    }
    return command;
  }