", only: "+DISABLE_COMPLETION.getValues());
}
}
protected static Settings readRuntimeProperties(Settings settings) {
SettingsBuilder builder = new SettingsBuilder(settings);
try {
String term = System.getProperty("aesh.terminal");
if(term != null && term.length() > 0) {
builder.terminal((Terminal) settings.getClass().getClassLoader().loadClass(term).newInstance());
}
String editMode = System.getProperty("aesh.editmode");
if(editMode != null && editMode.length() > 0) {
if(editMode.equalsIgnoreCase("VI"))
builder.mode(Mode.VI);
else if(editMode.equalsIgnoreCase("EMACS"))
builder.mode(Mode.EMACS);
}
String readInputrc = System.getProperty("aesh.readinputrc");
if(readInputrc != null && readInputrc.length() > 0)
if(readInputrc.equalsIgnoreCase("true") ||
readInputrc.equalsIgnoreCase("false"))
builder.readInputrc(Boolean.parseBoolean(readInputrc));
String inputrc = System.getProperty("aesh.inputrc");
if(inputrc != null && inputrc.length() > 0)
if(new File(inputrc).isFile())
builder.inputrc(new File(inputrc));
String historyFile = System.getProperty("aesh.historyfile");
if(historyFile != null && historyFile.length() > 0)
if(new File(historyFile).isFile())
builder.historyFile(new File(historyFile));
String historyPersistent = System.getProperty("aesh.historypersistent");
if(historyPersistent != null && historyPersistent.length() > 0)
if(historyPersistent.equalsIgnoreCase("true") ||
historyPersistent.equalsIgnoreCase("false"))
builder.persistHistory(Boolean.parseBoolean(historyPersistent));
String historyDisabled = System.getProperty("aesh.historydisabled");
if(historyDisabled != null && historyDisabled.length() > 0)
if(historyDisabled.equalsIgnoreCase("true") ||
historyDisabled.equalsIgnoreCase("false"))
builder.disableHistory(Boolean.parseBoolean(historyDisabled));
String historySize = System.getProperty("aesh.historysize");
if(historySize != null && historySize.length() > 0)
builder.historySize(Integer.parseInt(historySize));
String doLogging = System.getProperty("aesh.logging");
if(doLogging != null && doLogging.length() > 0)
if(doLogging.equalsIgnoreCase("true") ||
doLogging.equalsIgnoreCase("false"))
builder.logging(Boolean.parseBoolean(doLogging));
String logFile = System.getProperty("aesh.logfile");
if(logFile != null && logFile.length() > 0)
builder.logfile(logFile);
String disableCompletion = System.getProperty("aesh.disablecompletion");
if(disableCompletion != null && disableCompletion.length() > 0)
if(disableCompletion.equalsIgnoreCase("true") ||
disableCompletion.equalsIgnoreCase("false"))
builder.disableCompletion(Boolean.parseBoolean(disableCompletion));
}
catch (ClassNotFoundException e) {
if(settings.isLogging())
logger.log(Level.SEVERE, "Fail while finding class: ", e);
} catch (InstantiationException e) {
if(settings.isLogging())
logger.log(Level.SEVERE, "Fail while instantiating class: ", e);
} catch (IllegalAccessException e) {
if(settings.isLogging())
logger.log(Level.SEVERE, "Fail while accessing class: ", e);
}
return builder.create();
}