Skip to content

Commit 89271bc

Browse files
committed
Add error message when specifying a file and -b
1 parent c69f9ed commit 89271bc

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/main/java/technology/tabula/CommandLineApp.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ public static void main(String[] args) {
8181

8282
public void extractTables(CommandLine line) throws ParseException {
8383
if (line.hasOption('b')) {
84+
if (line.getArgs().length != 0) {
85+
throw new ParseException("Filename specified with batch\nTry --help for help");
86+
}
87+
8488
File pdfDirectory = new File(line.getOptionValue('b'));
8589
if (!pdfDirectory.isDirectory()) {
8690
throw new ParseException("Directory does not exist or is not a directory");
@@ -276,7 +280,7 @@ public static Options buildOptions() {
276280
o.addOption("u", "use-line-returns", false, "Use embedded line returns in cells. (Only in spreadsheet mode.)");
277281
o.addOption("d", "debug", false, "Print detected table areas instead of processing.");
278282
o.addOption(OptionBuilder.withLongOpt("batch")
279-
.withDescription("Convert all .pdfs in the provided directory")
283+
.withDescription("Convert all .pdfs in the provided directory.")
280284
.hasArg()
281285
.withArgName("DIRECTORY")
282286
.create("b"));

0 commit comments

Comments
 (0)