MCPcopy Create free account
hub / github.com/OpenAS2/OpenAs2App / parseCommandLine

Method parseCommandLine

Server/src/main/java/SplitCsvFile.java:51–73  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

49 }
50
51 private CommandLine parseCommandLine(String[] args) {
52 // create the command line parser
53 CommandLineParser parser = new DefaultParser();
54
55 // create the Options
56 Options options = new Options();
57 for (String[] opt : opts) {
58 Option option = Option.builder(opt[0]).longOpt(opt[1]).hasArg("true".equalsIgnoreCase(opt[2])).desc(opt[4]).get();
59 option.setRequired("true".equalsIgnoreCase(opt[3]));
60 options.addOption(option);
61 }
62
63 // parse the command line arguments
64 CommandLine line = null;
65 try {
66 line = parser.parse(options, args);
67 } catch (ParseException e) {
68 System.out.println("Command line parsing error: " + e.getMessage());
69 usage(options);
70 System.exit(-1);
71 }
72 return line;
73 }
74
75 private void process(String[] args) throws Exception {
76 CommandLine options = parseCommandLine(args);

Callers 1

processMethod · 0.95

Calls 4

usageMethod · 0.95
getMethod · 0.80
getMessageMethod · 0.65
parseMethod · 0.45

Tested by

no test coverage detected