|
|
|
@ -24,6 +24,14 @@ public class Main {
|
|
|
|
private static final Logger logger = Logger.getLogger(Main.class.getName());
|
|
|
|
private static final Logger logger = Logger.getLogger(Main.class.getName());
|
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) throws InterruptedException, JsonProcessingException {
|
|
|
|
public static void main(String[] args) throws InterruptedException, JsonProcessingException {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (args.length == 0) {
|
|
|
|
|
|
|
|
System.out.println("This program allows you to run several commands at the same time."
|
|
|
|
|
|
|
|
+ "\n\nUsage: java -jar splicer.jar cmd1 cmd2 cmd3 ..."
|
|
|
|
|
|
|
|
+ "\n\nExample: java -jar splicer.jar \"ls -l\" \"df -kh\"\n");
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ExecutorService executorService = Executors.newFixedThreadPool(args.length);
|
|
|
|
ExecutorService executorService = Executors.newFixedThreadPool(args.length);
|
|
|
|
|
|
|
|
|
|
|
|
List<Callable<ExecutionResult>> callables = List.of(args).stream()
|
|
|
|
List<Callable<ExecutionResult>> callables = List.of(args).stream()
|
|
|
|
|