Skip to content
Snippets Groups Projects
Commit eed0766d authored by Manos Koukoutos's avatar Manos Koukoutos
Browse files

Don't print help message when wrong option

parent 44216ee5
Branches
Tags
No related merge requests found
...@@ -25,8 +25,10 @@ abstract class LeonOptionDef[+A] { ...@@ -25,8 +25,10 @@ abstract class LeonOptionDef[+A] {
try { parser(s) } try { parser(s) }
catch { catch {
case _ : IllegalArgumentException => case _ : IllegalArgumentException =>
reporter.error(s"Invalid option usage: $usageDesc") reporter.fatalError(
Main.displayHelp(reporter, error = true) s"Invalid option usage: --$name\n" +
"Try 'leon --help' for more information."
)
} }
} }
......
...@@ -116,8 +116,10 @@ object Main { ...@@ -116,8 +116,10 @@ object Main {
} }
// Find respective LeonOptionDef, or report an unknown option // Find respective LeonOptionDef, or report an unknown option
val df = allOptions.find(_. name == name).getOrElse{ val df = allOptions.find(_. name == name).getOrElse{
initReporter.error(s"Unknown option: $name") initReporter.fatalError(
displayHelp(initReporter, error = true) s"Unknown option: $name\n" +
"Try 'leon --help' for more information."
)
} }
df.parse(value)(initReporter) df.parse(value)(initReporter)
} }
......
...@@ -14,7 +14,7 @@ case object CEGIS extends CEGISLike[TypeTree]("CEGIS") { ...@@ -14,7 +14,7 @@ case object CEGIS extends CEGISLike[TypeTree]("CEGIS") {
grammar = Grammars.typeDepthBound(Grammars.default(sctx, p), 2), // This limits type depth grammar = Grammars.typeDepthBound(Grammars.default(sctx, p), 2), // This limits type depth
rootLabel = {(tpe: TypeTree) => tpe }, rootLabel = {(tpe: TypeTree) => tpe },
optimizations = false, optimizations = false,
maxUnfoldings = 7 maxUnfoldings = 5
) )
} }
} }
...@@ -26,7 +26,7 @@ case object CEGIS2 extends CEGISLike[TaggedNonTerm[TypeTree]]("CEGIS2") { ...@@ -26,7 +26,7 @@ case object CEGIS2 extends CEGISLike[TaggedNonTerm[TypeTree]]("CEGIS2") {
grammar = TaggedGrammar(base), grammar = TaggedGrammar(base),
rootLabel = TaggedNonTerm(_, Tags.Top, 0, None), rootLabel = TaggedNonTerm(_, Tags.Top, 0, None),
optimizations = true, optimizations = true,
maxUnfoldings = 7 maxUnfoldings = 5
) )
} }
} }
...@@ -450,7 +450,6 @@ abstract class CEGISLike[T <: Typed](name: String) extends Rule(name) { ...@@ -450,7 +450,6 @@ abstract class CEGISLike[T <: Typed](name: String) extends Rule(name) {
evaluator.eval(eq, p.as.zip(ins).toMap) evaluator.eval(eq, p.as.zip(ins).toMap)
} }
timers.testForProgram.stop() timers.testForProgram.stop()
val l = timers.testForProgram.last
cTreeFd.fullBody = origImpl cTreeFd.fullBody = origImpl
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment