print usage information if user requests it with -h or -help

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150580 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Daniel Naber 2004-10-07 18:19:16 +00:00
parent 135f24a875
commit 1f11f2e937
1 changed files with 5 additions and 1 deletions

View File

@ -33,7 +33,11 @@ import org.apache.lucene.queryParser.QueryParser;
class SearchFiles {
public static void main(String[] args) throws Exception {
String usage =
"java org.apache.lucene.demo.SearchFiles [-index dir] [-field f] [-repeat n] [-queries file] [-raw] ";
"Usage: java org.apache.lucene.demo.SearchFiles [-index dir] [-field f] [-repeat n] [-queries file] [-raw] ";
if (args.length > 0 && ("-h".equals(args[0]) || "-help".equals(args[0]))) {
System.out.println(usage);
System.exit(0);
}
String index = "index";
String field = "contents";