From 16146cbd32bcb5b5f2a00f57dd6bdb17c3570f88 Mon Sep 17 00:00:00 2001 From: Otis Gospodnetic Date: Tue, 30 Mar 2004 13:22:59 +0000 Subject: [PATCH] - Applied a patch for bug 28030: http://issues.apache.org/bugzilla/show_bug.cgi?id=28030 (and made some small changes to it) PR: 28030 Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150266 13f79535-47bb-0310-9956-ffa450edef68 --- src/demo/org/apache/lucene/demo/IndexFiles.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/demo/org/apache/lucene/demo/IndexFiles.java b/src/demo/org/apache/lucene/demo/IndexFiles.java index e39b1a9d3f4..f77f5c9846a 100644 --- a/src/demo/org/apache/lucene/demo/IndexFiles.java +++ b/src/demo/org/apache/lucene/demo/IndexFiles.java @@ -26,9 +26,14 @@ import java.util.Date; class IndexFiles { public static void main(String[] args) throws IOException { - try { - Date start = new Date(); + String usage = "java " + IndexFiles.class + " "; + if (args.length == 0) { + System.err.println("Usage: " + usage); + System.exit(1); + } + Date start = new Date(); + try { IndexWriter writer = new IndexWriter("index", new StandardAnalyzer(), true); indexDocs(writer, new File(args[0])); @@ -42,7 +47,7 @@ class IndexFiles { } catch (IOException e) { System.out.println(" caught a " + e.getClass() + - "\n with message: " + e.getMessage()); + "\n with message: " + e.getMessage()); } }