Skip to content

Commit 205b20f

Browse files
committed
output for missing option, added working program call to readme
1 parent a629aa5 commit 205b20f

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ You may use the following parameters when calling the program:
2929

3030
Example call:
3131
```
32-
java -jar XXX.jar -osm 5cc58071facf70001a872bef -measurements
33-
-timerange 2019-05-01T00:00:00.000Z 2019-05-15T00:00:00.000Z -path /rdf.out
32+
java -jar XXX.jar -osm 5cc58071facf70001a872bef
33+
-measurements
34+
-timerange 2019-05-01T00:00:00.000Z 2019-05-15T00:00:00.000Z
35+
-path file.out
3436
```
3537

3638
### Tests

src/main/java/Main.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import org.apache.commons.cli.CommandLine;
2+
import org.apache.commons.cli.MissingOptionException;
23
import org.apache.commons.cli.ParseException;
34

45
import osm.util.OpenSenseMapHandler;
@@ -9,10 +10,18 @@
910
public class Main {
1011
public static void main(String[] args) throws ParseException, IOException {
1112

12-
CommandLine config = new Config().parseArgs(args);
13+
try {
14+
CommandLine config = new Config().parseArgs(args);
1315

14-
if (config.hasOption("osm")) {
15-
new OpenSenseMapHandler().handleConfig(config);
16+
if (config.hasOption("osm")) {
17+
new OpenSenseMapHandler().handleConfig(config);
18+
} else {
19+
System.out.println("No data source specified.");
20+
System.out.println("Please refer to the README.");
21+
}
22+
} catch (MissingOptionException e) {
23+
System.out.println("You are missing the following options: " + e.getMissingOptions());
24+
System.out.println("Please refer to the README.");
1625
}
1726
}
1827
}

0 commit comments

Comments
 (0)