Specify data directory via CLI argument

This commit is contained in:
coolneng 2021-01-10 19:55:08 +01:00
parent 7282a5c69f
commit 4e7c880b93
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 14 additions and 0 deletions

View File

@ -93,4 +93,18 @@ public class Indexer {
} }
commitChanges(); commitChanges();
} }
private static void usage() {
System.out.println("Usage: Indexer <directory>");
System.exit(1);
}
public static void main(String[] args) throws ParseException, IOException {
if (args.length != 1) {
usage();
}
String dataDirectory = args[0];
Indexer indexer = new Indexer(dataDirectory);
indexer.populateIndex();
}
} }