Skip to content

Commit

Permalink
Merge pull request #1055 from virtualcell/SetCLIToHeadless
Browse files Browse the repository at this point in the history
Set cli to headless
  • Loading branch information
CodeByDrescher authored Nov 27, 2023
2 parents 6e104e1 + eb8a43c commit b095d4a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion vcell-cli/src/main/java/org/vcell/cli/CLIStandalone.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static class UserTypeConverter implements CommandLine.ITypeConverter<User> {
public User convert(String userString) {
// expecting "userid:key" format
String[] tokens = userString.split(":");
if (tokens == null || tokens.length != 2){
if (tokens.length != 2){
throw new RuntimeException("'"+userString+"' not in 'userid:userkey' format");
}
String userid = tokens[0];
Expand Down
22 changes: 16 additions & 6 deletions vcell-cli/src/main/java/org/vcell/cli/run/ExecuteCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,15 @@ public class ExecuteCommand implements Callable<Integer> {


public Integer call() {
CLIRecorder cliLogger = null;
CLIRecorder cliLogger;
try {

Level logLevel = logger.getLevel();
Level logLevel;
if (!bQuiet && bDebug) {
logLevel = Level.DEBUG;
} else if (bQuiet) {
logLevel = Level.OFF;
} else {
logLevel = logger.getLevel();
}

// CLILogger will throw an exception if our output dir isn't valid.
Expand All @@ -80,9 +81,18 @@ public Integer call() {
logger.debug("Execution mode requested");

String trace_args = String.format(
"Arguments:\nInput\t: \"%s\"\nOutput\t: \"%s\"\nWriteLogs\t: %b\n" +
"KeepTemp\t: %b\nExactMatch\t: %b\nEncapOut\t: %b\nTimeout\t: %dms\n" +
"Help\t: %b\nDebug\t: %b\nQuiet\t: %b",
"""
Arguments:
Input\t: "%s"
Output\t: "%s"
WriteLogs\t: %b
KeepTemp\t: %b
ExactMatch\t: %b
EncapsulateOut\t: %b
Timeout\t: %dms
Help\t: %b
Debug\t: %b
Quiet\t: %b""",
inputFilePath.getAbsolutePath(), outputFilePath.getAbsolutePath(), bWriteLogFiles,
bKeepTempFiles, bExactMatchOnly, bEncapsulateOutput,
EXECUTABLE_MAX_WALLCLOCK_MILLIS, help, bDebug, bQuiet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ private VCellUtilityHub(MODE m){

private void startVCellCLI(){
VCellUtilityHub.logManager = CLIRecordManager.getInstance();
System.setProperty("java.awt.headless", "true");
}

private void startVCellStandard(){
Expand Down

0 comments on commit b095d4a

Please sign in to comment.