Commit a7e7a499 authored by Moritz Schott's avatar Moritz Schott
Browse files

remove accidentially added file, make multithreading cli-option propperly overwrite file option

parent b9a7cfaf
Pipeline #3335 passed with stage
in 0 seconds
......@@ -59,8 +59,8 @@ public abstract class OSHDBApplication implements Callable<Integer> {
@Option(names = {"--prefix"}, description = "prefix to use")
protected String prefix;
@Option(names = {"--multithreading"}, description = "for jdbc based connections")
protected boolean multithreading;
@Option(names = {"--multithreading"}, description = "for jdbc based connections", negatable=true)
protected Boolean multithreading = null;
protected Properties props;
......@@ -92,7 +92,7 @@ public abstract class OSHDBApplication implements Callable<Integer> {
configOrUrl.oshdbUrl = PropsUtil.get(props, "oshdb").orElseThrow();
keytableUrl = PropsUtil.get(props, "keytables").orElse(null);
prefix = PropsUtil.get(props, "prefix").orElse("");
multithreading = PropsUtil.get(props, "multithreading").isPresent();
multithreading = Boolean.valueOf(PropsUtil.get(props, "multithreading").orElse("false"));
return run(connection);
}
......
package org.heigit.ohsome.oshdb.helpers;
import java.util.concurrent.Callable;
import picocli.CommandLine;
@CommandLine.Command(mixinStandardHelpOptions = true, sortOptions = false)
public class PicocliTest implements Callable<Integer> {
@CommandLine.ArgGroup(heading = "Group heading%n", multiplicity = "1")
GroupArguments args;
static class GroupArguments {
@CommandLine.ArgGroup(exclusive = false, multiplicity = "1")
AorB aorb;
static class AorB {
@CommandLine.Option(names = {"--a"})
protected String a;
@CommandLine.Option(names = {"--b"})
protected String b;
}
@CommandLine.Option(required = true, names = {"--important"})
protected boolean important;
@CommandLine.Option(names = {"--notImportant"})
protected boolean notImportant;
}
@CommandLine.Option(names = {"--alsoNotImportant"})
protected boolean alsoNotImportant;
public static void main(String[] args) {
new CommandLine(new PicocliTest()).execute(args);
}
@Override
public Integer call() throws Exception {
System.out.println(args.aorb.a);
return 0;
}
}
......@@ -28,8 +28,8 @@ public class PropsUtil {
}
}
public static void set(Properties props, String key, boolean value) {
if(value) {
public static void set(Properties props, String key, Boolean value) {
if(value!=null) {
props.setProperty(key, Boolean.toString(value));
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment