MCPcopy Create free account
hub / github.com/apache/solr / parseCmdLine

Method parseCmdLine

solr/core/src/java/org/apache/solr/cli/SolrCLI.java:125–153  ·  view source on GitHub ↗
(Tool tool, String[] args)

Source from the content-addressed store, hash-verified

123 return newTool(toolType, runtime);
124 }
125
126 public static CommandLine parseCmdLine(Tool tool, String[] args) throws IOException {
127 // the parser doesn't like -D props
128 List<String> toolArgList = new ArrayList<>();
129 List<String> dashDList = new ArrayList<>();
130 for (int a = 1; a < args.length; a++) {
131 String arg = args[a];
132 if (!args[a - 1].equals("--jvm-opts") && arg.startsWith("-D")) {
133 dashDList.add(arg);
134 } else {
135 toolArgList.add(arg);
136 }
137 }
138 String[] toolArgs = toolArgList.toArray(new String[0]);
139
140 // process command-line args to configure this application
141 CommandLine cli = processCommandLineArgs(tool, toolArgs);
142
143 List<String> argList = cli.getArgList();
144 argList.addAll(dashDList);
145
146 // for SSL support, try to accommodate relative paths set for SSL store props
147 String solrInstallDir = EnvUtils.getProperty("solr.install.dir");
148 if (solrInstallDir != null) {
149 checkSslStoreSysProp(solrInstallDir, "keyStore");
150 checkSslStoreSysProp(solrInstallDir, "trustStore");
151 }
152
153 return cli;
154 }
155
156 protected static void checkSslStoreSysProp(String solrInstallDir, String key) {

Callers 3

mainMethod · 0.95
runExampleMethod · 0.95
runToolMethod · 0.80

Calls 7

checkSslStoreSysPropMethod · 0.95
toArrayMethod · 0.80
addMethod · 0.65
equalsMethod · 0.45
addAllMethod · 0.45
getPropertyMethod · 0.45

Tested by 1

runToolMethod · 0.64