MCPcopy Create free account
hub / github.com/questdb/questdb / processArgs

Method processArgs

core/src/main/java/io/questdb/Bootstrap.java:243–268  ·  view source on GitHub ↗
(String... args)

Source from the content-addressed store, hash-verified

241 }
242
243 public static CharSequenceObjHashMap<String> processArgs(String... args) {
244 final int n = args.length;
245 if (n == 0) {
246 throw new BootstrapException("Arguments expected, non provided");
247 }
248 CharSequenceObjHashMap<String> optHash = new CharSequenceObjHashMap<>();
249 for (int i = 0; i < n; i++) {
250 String arg = args[i];
251 if (arg.length() > 1 && arg.charAt(0) == '-') {
252 if (i + 1 < n) {
253 String nextArg = args[i + 1];
254 if (nextArg.length() > 1 && nextArg.charAt(0) == '-') {
255 optHash.put(arg, "");
256 } else {
257 optHash.put(arg, nextArg);
258 i++;
259 }
260 } else {
261 optHash.put(arg, "");
262 }
263 } else {
264 optHash.put("$" + i, arg);
265 }
266 }
267 return optHash;
268 }
269
270 public static void reportCrashFiles(CairoConfiguration cairoConfiguration, Log log) {
271 final CharSequence dbRoot = cairoConfiguration.getDbRoot();

Callers 4

testProcessArgsMethod · 0.95
testProcessArgsNoArgsMethod · 0.95
BootstrapMethod · 0.95

Calls 3

putMethod · 0.95
lengthMethod · 0.65
charAtMethod · 0.45

Tested by 3

testProcessArgsMethod · 0.76
testProcessArgsNoArgsMethod · 0.76