@@ -0,0 +1,1183 @@
+package exporter.examples;%0A%0Aimport java.util.Date;%0A%0Aimport org.apache.commons.cli.BasicParser;%0Aimport org.apache.commons.cli.CommandLine;%0Aimport org.apache.commons.cli.Options;%0Aimport org.apache.commons.cli.ParseException;%0A%0A// Example of application using CLI%0Apublic class DateApp %7B%0A%0A%09public static void main(String%5B%5D args) throws ParseException %7B%0A%0A%09%09// create Options object%0A%09%09Options options = new Options();%0A%0A%09%09// add t option%0A%09%09options.addOption(%22time%22, false, %22displays current time%22);%0A%09%09options.addOption(%22date%22, false, %22displays current time%22);%0A%0A%09%09// There are several implementations to parse command line arguments,%0A%09%09// the recommended one is the DefaultParser but I can't find it in the%0A%09%09// library, probably outdated documentation%0A%09%09BasicParser parser = new BasicParser();%0A%09%09CommandLine cmd = parser.parse(options, args);%0A%0A%09%09if (cmd.hasOption(%22time%22)) %7B%0A%0A%09%09%09Date date = new Date();%0A%09%09%09// current time%0A%09%09%09String str = String.format(%22Current Time : %25tT%22, date);%0A%09%09%09System.out.printf(str);%0A%0A%09%09%7D else if (cmd.hasOption(%22date%22)) %7B%0A%0A%09%09%09Date date = new Date();%0A%09%09%09// current date%0A%09%09%09String str = String.format(%22Current Date : %25tF%22, date);%0A%09%09%09System.out.printf(str);%0A%0A%09%09%7D%0A%0A%09%7D%0A%7D%0A

Add example using command line interface