Fix typo on One Time option

This commit is contained in:
Maxime Chassagneux
2017-01-31 16:52:40 +01:00
parent 7e0306a11b
commit 5e5fce2bb5

View File

@@ -26,7 +26,7 @@ public class Cli {
public static Option fileParam = new Option( "paramfile", true , "Input a param file" );
public static Option debugOption = new Option( "debug", "Active debug output message" );
public static Option infoOption = new Option( "info", "Active info output message" );
public static Option once = new Option( "once", "Read the file once time" );
public static Option oneTime = new Option( "oneTime", "Read the file once time" );
private static long lastModifiedTime = 0L;
public Cli() {
// TODO Auto-generated constructor stub
@@ -53,7 +53,7 @@ public class Cli {
HelpFormatter formatter = new HelpFormatter();
boolean readFromStart = false;
boolean onceTime = false;
boolean onlyOneTime = false;
CommandLineParser parser = new DefaultParser();
CommandLine cmd = null;
try {
@@ -93,8 +93,8 @@ public class Cli {
System.exit(0);
}
if(cmd.hasOption("once")) {
onceTime = true;
if(cmd.hasOption("oneTime")) {
onlyOneTime = true;
}
if(cmd.hasOption("paramfile")) {
@@ -103,7 +103,7 @@ public class Cli {
ParserEngine engine = new ParserEngine(patternPath);
Log log = Log.getLogger(Cli.class.getName());
try {
startParserFromFile(param, engine , onceTime);
startParserFromFile(param, engine , onlyOneTime);
lastModifiedTime = param.lastModified();
log.info("All parsers started");
// Check for reload the param file
@@ -115,7 +115,7 @@ public class Cli {
if ( param.lastModified() != lastModifiedTime )
{
engine.stopAllParser();
startParserFromFile(param, engine , onceTime);
startParserFromFile(param, engine , onlyOneTime);
lastModifiedTime = param.lastModified();
}
}
@@ -161,7 +161,7 @@ public class Cli {
String[] filesName = cmd.getOptionValues("logfile");
for (int i = 0; i < filesName.length ; i++) {
File f = new File (filesName[i]);
engine.addNewParser(f, regexName[i], applicationName, readFromStart, onceTime);
engine.addNewParser(f, regexName[i], applicationName, readFromStart, onlyOneTime);
}
}
}