Skip to content

Commit

Permalink
Fixed configs with help, etc
Browse files Browse the repository at this point in the history
  • Loading branch information
leventeBajczi committed Jan 10, 2024
1 parent b96a7cf commit 43d3ac9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ class XcfaCli(private val args: Array<String>) {
@Parameter(names = ["--config", "-c"], description = "Configuration file (CLI options will overwrite these!)")
var configFile: File? = null

@Parameter(names = ["--help", "-h"], help = true)
private var help = false

@Parameter
var remainingFlags: MutableList<String> = ArrayList()

Expand Down Expand Up @@ -79,6 +82,16 @@ class XcfaCli(private val args: Array<String>) {
exitProcess(ExitCodes.INVALID_PARAM.code)
}


if (help) {
val builder = JCommander.newBuilder().addObject(this)
for (obj in config.getObjects()) {
builder.addObject(obj)
}
builder.build().usage()
return
}

/// version
if (config.outputConfig.versionInfo) {
CliUtils.printVersion(System.out)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ fun registerAllSolverManagers(home: String, logger: Logger) {
SolverManager.closeAll()
// register solver managers
SolverManager.registerSolverManager(Z3SolverManager.create())
logger.write(Logger.Level.INFO, "Registered Z3 SolverManager")
logger.write(Logger.Level.INFO, "Registered Z3 SolverManager\n")
if (OsHelper.getOs() == OsHelper.OperatingSystem.LINUX) {
val homePath = Path.of(home)
val smtLibSolverManager: SmtLibSolverManager = SmtLibSolverManager.create(homePath, logger)
SolverManager.registerSolverManager(smtLibSolverManager)
logger.write(Logger.Level.INFO, "Registered SMT-LIB SolverManager")
logger.write(Logger.Level.INFO, "Registered SMT-LIB SolverManager\n")
}
}

0 comments on commit 43d3ac9

Please sign in to comment.