Example #1
0
 private File readParamFileIn(CliArguments arguments) {
   if (arguments.argumentCount() > 0) {
     // first argument is in-file
     return new File(arguments.argument(0));
   }
   return null; // no in-file
 }
Example #2
0
 private Format readOptionFormat(CliArguments arguments) {
   Format format = Format.AUTO;
   if (arguments.hasOption("format")) {
     format = Format.valueOf(arguments.option("format").toUpperCase());
   }
   return format;
 }
Example #3
0
 private String readOptionComment(CliArguments arguments) {
   if (arguments.hasOption("comment")) {
     return arguments.option("comment");
   }
   return null;
 }
Example #4
0
 private Charset readOptionEncoding(CliArguments arguments) {
   if (arguments.hasOption("encoding")) {
     return Charset.forName(arguments.option("encoding"));
   }
   return null;
 }
Example #5
0
 private static boolean wantsHelp(CliArguments args) {
   return args.optionCount() == 1 && args.hasOption("h");
 }
Example #6
0
 private File readOptionFileOut(CliArguments arguments) {
   if (arguments.hasOption("out")) {
     return new File(arguments.option("out"));
   }
   return null; // no out-file
 }