I have a main method that takes an unlimited number of arguments.
It is in the form of:
if (args.length == 0) {
// This is what I would like to explain better
System.out.println("Usage: selectField1 [...] whereConditionField:Value [...]");
System.exit(0);
}
List<String> selectList = new ArrayList<String>();
BooleanQuery booleanQuery = new BooleanQuery();
for (String arg : args) {
if (arg.contains(":")) {
// Argument is a WHERE condition
String[] keyValue = arg.split(":");
Term term = new Term(keyValue[0], keyValue[1]);
booleanQuery.add(new TermQuery(term), BooleanClause.Occur.MUST);
} else {
// Argument is a SELECT field
selectList.add(arg);
}
}
What is the proper way to explain this in the Usage output?