Skip to content

Commit

Permalink
Fix -T flag parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
Meeples10 committed Oct 5, 2023
1 parent 24e03ed commit ae300e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>io.github.meeples10.mcresourceanalyzer</groupId>
<artifactId>mc-resource-analyzer</artifactId>
<version>1.2.1</version>
<version>1.2.2</version>
<packaging>jar</packaging>

<name>MCResourceAnalyzer</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public String[] getVersion() throws Exception {
.description("Adds a prefix to the program's output files.").build());
spec.addOption(OptionSpec.builder("-t", "--table")
.description("Generates a simple HTML table with the collected data.").build());
spec.addOption(OptionSpec.builder("-T", "--table-template").paramLabel("PATH").type(int.class).description(
spec.addOption(OptionSpec.builder("-T", "--table-template").paramLabel("PATH").type(String.class).description(
"All instances of {{{TABLE}}} in the given file will be replaced by the table generated by the -t option.")
.build());
spec.addOption(OptionSpec.builder("-s", "--statistics")
Expand Down Expand Up @@ -171,7 +171,11 @@ private static int parseArgs(ParseResult pr) {
if(pr.hasMatchedOption('T')) {
File template = new File((String) pr.matchedOption('T').getValue());
if(!template.exists() || template.isDirectory()) {
System.err.println("Invalid table template: " + template.getPath());
System.err.println("Table template not found: " + template.getPath());
System.exit(1);
}
if(template.isDirectory()) {
System.err.println("Table template must be a file: " + template.getPath());
System.exit(1);
}
tableTemplatePath = template.getPath();
Expand Down

0 comments on commit ae300e4

Please sign in to comment.