Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Eric Duminil
RegionChooser
Commits
b5d693f8
Commit
b5d693f8
authored
2 years ago
by
Eric Duminil
Browse files
Options
Download
Email Patches
Plain Diff
TRying to read stdin
parent
bc0f1e69
master
develop
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/eu/simstadt/regionchooser/RegionChooserCommandLineInterface.java
+13
-0
...tadt/regionchooser/RegionChooserCommandLineInterface.java
with
13 additions
and
0 deletions
+13
-0
src/main/java/eu/simstadt/regionchooser/RegionChooserCommandLineInterface.java
+
13
-
0
View file @
b5d693f8
...
...
@@ -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
)
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets