Skip to content

Commit a2b1a81

Browse files
committed
Unhide the -mainlog switch (from -help).
1 parent debf055 commit a2b1a81

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

prism/src/prism/PrismCL.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,6 +1118,17 @@ private void initSwitchHandlers()
11181118
"<dir>", "Set current working directory");
11191119
registry.addSwitch("settings", new StringSwitch(s -> settingsFilename = s.trim()),
11201120
"<file>", "Load settings from <file>");
1121+
boolean[] appendToLog = {false};
1122+
registry.addSwitch("mainlog", new StringPlusOptionsSwitch(
1123+
new OptionParser().flag("append", "Append to the log file, rather than overwriting it", () -> appendToLog[0] = true),
1124+
(file, parse) -> {
1125+
appendToLog[0] = false;
1126+
parse.run();
1127+
try { mainLog = new PrismFileLog(file, appendToLog[0]); prism.setMainLog(mainLog); }
1128+
1129+
catch (PrismException e) { errorAndExit("Couldn't open log file \"" + file + "\""); }
1130+
}),
1131+
"<file>[:<options>]", "Write the log to <file> instead of stdout");
11211132

11221133
registry.addBlankLine();
11231134

@@ -1535,15 +1546,6 @@ private void initSwitchHandlers()
15351546
// Hidden miscellaneous switches
15361547
registry.addSwitch("explicitbuild", new FlagSwitch(() -> explicitbuild = true));
15371548
registry.addSwitch("explicitbuildtest", new FlagSwitch(() -> explicitbuildtest = true));
1538-
boolean[] appendToLog = {false};
1539-
registry.addSwitch("mainlog", new StringPlusOptionsSwitch(
1540-
new OptionParser().flag("append", () -> appendToLog[0] = true),
1541-
(file, parse) -> {
1542-
appendToLog[0] = false;
1543-
parse.run();
1544-
try { mainLog = new PrismFileLog(file, appendToLog[0]); prism.setMainLog(mainLog); }
1545-
catch (PrismException e) { errorAndExit("Couldn't open log file \"" + file + "\""); }
1546-
}));
15471549
registry.addSwitch("exportmodeldotview", new FlagSwitch(() -> exportmodeldotview = true));
15481550
registry.addSwitch("c1", new FlagSwitch(() -> prism.setConstruction(1)));
15491551
registry.addSwitch("c2", new FlagSwitch(() -> prism.setConstruction(2)));

0 commit comments

Comments
 (0)