From 4e7c880b9378767c2afcc86b621b357774e4a2c2 Mon Sep 17 00:00:00 2001 From: coolneng Date: Sun, 10 Jan 2021 19:55:08 +0100 Subject: [PATCH] Specify data directory via CLI argument --- src/main/java/org/RI/P2/Indexer.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/org/RI/P2/Indexer.java b/src/main/java/org/RI/P2/Indexer.java index f61d6c5..494f5c4 100644 --- a/src/main/java/org/RI/P2/Indexer.java +++ b/src/main/java/org/RI/P2/Indexer.java @@ -93,4 +93,18 @@ public class Indexer { } commitChanges(); } + + private static void usage() { + System.out.println("Usage: Indexer "); + 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(); + } }