Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
inox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LARA
inox
Commits
672e403a
Commit
672e403a
authored
9 years ago
by
Manos Koukoutos
Browse files
Options
Downloads
Patches
Plain Diff
Improve help message
parent
89a4d95b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/scala/leon/Main.scala
+10
-6
10 additions, 6 deletions
src/main/scala/leon/Main.scala
src/main/scala/leon/SharedOptions.scala
+6
-1
6 additions, 1 deletion
src/main/scala/leon/SharedOptions.scala
with
16 additions
and
7 deletions
src/main/scala/leon/Main.scala
+
10
−
6
View file @
672e403a
...
...
@@ -33,33 +33,37 @@ object Main {
object
MainComponent
extends
LeonComponent
{
val
name
=
"main"
val
description
=
"
The main Leon component, handl
in
g
the
top-level options
"
val
description
=
"
Options that determ
in
e
the
feature of Leon to be used (mutually exclusive). Default: verify
"
val
optTermination
=
LeonFlagOptionDef
(
"termination"
,
"Check program termination"
,
false
)
val
optRepair
=
LeonFlagOptionDef
(
"repair"
,
"Repair selected functions"
,
false
)
val
optSynthesis
=
LeonFlagOptionDef
(
"synthesis"
,
"Partial synthesis of choose() constructs"
,
false
)
val
optXLang
=
LeonFlagOptionDef
(
"xlang"
,
"Support for extra program constructs (imperative,...)"
,
false
)
val
optWatch
=
LeonFlagOptionDef
(
"watch"
,
"Rerun pipeline when file changes"
,
false
)
val
optNoop
=
LeonFlagOptionDef
(
"noop"
,
"No operation performed, just output program"
,
false
)
val
optVerify
=
LeonFlagOptionDef
(
"verify"
,
"Verify function contracts"
,
true
)
val
optHelp
=
LeonFlagOptionDef
(
"help"
,
"Show help message"
,
false
)
val
optEval
=
LeonFlagOptionDef
(
"eval"
,
"Evaluate ground functions"
,
false
)
override
val
definedOptions
:
Set
[
LeonOptionDef
[
Any
]]
=
Set
(
optTermination
,
optRepair
,
optSynthesis
,
optXLang
,
optWatch
,
optNoop
,
optHelp
,
optVerify
,
optEval
)
Set
(
optTermination
,
optRepair
,
optSynthesis
,
optXLang
,
optNoop
,
optHelp
,
optVerify
,
optEval
)
}
lazy
val
allOptions
:
Set
[
LeonOptionDef
[
Any
]]
=
allComponents
.
flatMap
(
_
.
definedOptions
)
def
displayHelp
(
reporter
:
Reporter
,
error
:
Boolean
)
=
{
reporter
.
info
(
"Top-level options:"
)
reporter
.
info
(
MainComponent
.
description
)
for
(
opt
<-
MainComponent
.
definedOptions
.
toSeq
.
sortBy
(
_
.
name
))
{
reporter
.
info
(
opt
.
helpString
)
}
reporter
.
info
(
""
)
for
(
opt
<-
(
MainComponent
.
definedOptions
++
SharedOptions
.
definedOptions
).
toSeq
.
sortBy
(
_
.
name
))
{
reporter
.
info
(
"Additional top-level options"
)
for
(
opt
<-
SharedOptions
.
definedOptions
.
toSeq
.
sortBy
(
_
.
name
))
{
reporter
.
info
(
opt
.
helpString
)
}
reporter
.
info
(
""
)
reporter
.
info
(
"Additional options, by component:"
)
for
(
c
<-
(
allComponents
-
MainComponent
-
SharedOptions
).
toSeq
.
sortBy
(
_
.
name
)
if
c
.
definedOptions
.
nonEmpty
)
{
...
...
@@ -198,7 +202,7 @@ object Main {
ctx
.
interruptManager
.
registerSignalHandler
()
val
doWatch
=
ctx
.
findOptionOrDefault
(
MainComponent
.
optWatch
)
val
doWatch
=
ctx
.
findOptionOrDefault
(
SharedOptions
.
optWatch
)
if
(
doWatch
)
{
val
watcher
=
new
FilesWatcher
(
ctx
,
ctx
.
files
)
...
...
This diff is collapsed.
Click to expand it.
src/main/scala/leon/SharedOptions.scala
+
6
−
1
View file @
672e403a
...
...
@@ -12,6 +12,8 @@ object SharedOptions extends LeonComponent {
val
optStrictPhases
=
LeonFlagOptionDef
(
"strict"
,
"Terminate after each phase if there is an error"
,
true
)
val
optWatch
=
LeonFlagOptionDef
(
"watch"
,
"Rerun pipeline when file changes"
,
false
)
val
optFunctions
=
new
LeonOptionDef
[
Seq
[
String
]]
{
val
name
=
"functions"
val
description
=
"Only consider functions f1, f2, ..."
...
...
@@ -31,7 +33,10 @@ object SharedOptions extends LeonComponent {
val
optDebug
=
new
LeonOptionDef
[
Set
[
DebugSection
]]
{
import
OptionParsers._
val
name
=
"debug"
val
description
=
"Enable detailed messages per component"
val
description
=
(
"Enable detailed messages per component.\nAvailable:"
+:
DebugSections
.
all
.
toSeq
.
map
(
_
.
name
).
sorted
).
mkString
(
"\n "
)
val
default
=
Set
[
DebugSection
]()
val
usageRhs
=
"d1,d2,..."
val
debugParser
:
OptionParser
[
Set
[
DebugSection
]]
=
s
=>
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment