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
d60c518a
There was an error fetching the commit references. Please try again later.
Commit
d60c518a
authored
10 years ago
by
Manos Koukoutos
Browse files
Options
Downloads
Patches
Plain Diff
Some pretty printing improvements for options
parent
522d4c5e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/scala/leon/LeonOption.scala
+1
-2
1 addition, 2 deletions
src/main/scala/leon/LeonOption.scala
src/main/scala/leon/Main.scala
+7
-0
7 additions, 0 deletions
src/main/scala/leon/Main.scala
with
8 additions
and
2 deletions
src/main/scala/leon/LeonOption.scala
+
1
−
2
View file @
d60c518a
...
...
@@ -15,8 +15,7 @@ abstract class LeonOptionDef[+A] {
else
s
"--$name=$usageRhs"
}
def
helpString
=
{
val
(
hd
::
tl
)
=
description
.
split
(
"\n"
).
toList
(
f
"$usageDesc%-21s $hd"
::
(
tl
map
(
" "
*
22
+
_
))).
mkString
(
"\n"
)
f
"$usageDesc%-22s"
+
description
.
replaceAll
(
"\n"
,
"\n"
+
" "
*
22
)
}
private
def
parseValue
(
s
:
String
)(
implicit
reporter
:
Reporter
)
:
A
=
{
...
...
This diff is collapsed.
Click to expand it.
src/main/scala/leon/Main.scala
+
7
−
0
View file @
d60c518a
...
...
@@ -51,6 +51,7 @@ object Main {
lazy
val
allOptions
:
Set
[
LeonOptionDef
[
Any
]]
=
allComponents
.
flatMap
(
_
.
definedOptions
)
def
displayHelp
(
reporter
:
Reporter
,
error
:
Boolean
)
=
{
reporter
.
info
(
"Top-level options:"
)
reporter
.
info
(
""
)
for
(
opt
<-
(
MainComponent
.
definedOptions
++
SharedOptions
.
definedOptions
).
toSeq
.
sortBy
(
_
.
name
))
{
...
...
@@ -70,6 +71,11 @@ object Main {
exit
(
error
)
}
def
displayVersion
(
reporter
:
Reporter
)
=
{
reporter
.
info
(
"Leon verification and synthesis tool (http://leon.epfl.ch/)"
)
reporter
.
info
(
""
)
}
private
def
exit
(
error
:
Boolean
)
=
sys
.
exit
(
if
(
error
)
1
else
0
)
def
processOptions
(
args
:
Seq
[
String
])
:
LeonContext
=
{
...
...
@@ -133,6 +139,7 @@ object Main {
val
verifyF
=
ctx
.
findOptionOrDefault
(
optVerify
)
if
(
helpF
)
{
displayVersion
(
ctx
.
reporter
)
displayHelp
(
ctx
.
reporter
,
error
=
false
)
}
else
{
val
pipeBegin
:
Pipeline
[
List
[
String
]
,
Program
]
=
...
...
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