HelpFormatter help =
new
HelpFormatter();
Options options =
new
Options();
options.addOption(
"h"
,
"help"
,
false
,
"print program usage"
);
options.addOption(
"n"
,
"name"
,
true
,
"sets job name"
);
CommandLineParser parser =
new
BasicParser();
CommandLine cline;
try
{
cline = parser.parse(options, args);
args = cline.getArgs();
if
(args.length <
1
) {
help.printHelp(CMDLINE, options);
return
-
1
;
}
}
catch
(ParseException e) {
System.out.println(e);
e.printStackTrace();
help.printHelp(CMDLINE, options);
return
-
1
;
}
String name =
null
;
try
{
if
(cline.hasOption(
'n'
))
name = cline.getOptionValue(
'n'
);
else
name =
"wildnove.com - Tutorial MultiTableOutputFormat "
;