Commit b5d693f8 authored by Eric Duminil's avatar Eric Duminil
Browse files

TRying to read stdin

parent bc0f1e69
......@@ -2,6 +2,7 @@
import java.nio.file.Path;
import java.util.List;
import java.util.Scanner;
import java.util.concurrent.Callable;
import picocli.CommandLine;
import picocli.CommandLine.Command;
......@@ -31,9 +32,21 @@ public Integer call() throws Exception { // your business logic goes here...
System.out.print("in ");
System.out.println(srsName + " coordinates.");
if (System.in.available() == 0) {
System.out.println("OH NOEs, NO INPUT!");
} else {
System.out.println("Here's standard input:");
System.out.println(getInput());
System.out.println("Done");
}
return 0;
}
private static String getInput() {
Scanner myObj = new Scanner(System.in);
return myObj.nextLine();
}
// this example implements Callable, so parsing, error handling and handling user
// requests for usage help or version help can be done with one line of code.
public static void main(String... args) {
......
Markdown is supported
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