static DashboardArguments readCommandLine()

in dashboard/src/main/java/com/google/cloud/tools/opensource/dashboard/DashboardArguments.java [99:116]


  static DashboardArguments readCommandLine(String... arguments) throws ParseException {
    CommandLineParser parser = new DefaultParser();

    try {
      // Throws ParseException if required option group ('-f' or '-c') is not specified
      CommandLine commandLine = parser.parse(options, arguments);
      String dependencyMediationValue = commandLine.getOptionValue('m');
      if (dependencyMediationValue != null
          && !validDependencyMediationValues.contains(dependencyMediationValue)) {
        throw new ParseException("Valid values for '-m' are " + validDependencyMediationValues);
      }

      return new DashboardArguments(commandLine);
    } catch (ParseException ex) {
      helpFormatter.printHelp("DashboardMain", options);
      throw ex;
    }
  }