Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
riseclipse-validator-scl2003
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
Container Registry
Model registry
Operate
Environments
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
RiseClipseGroup
riseclipse-validator-scl2003
Commits
0d5bd596
Commit
0d5bd596
authored
5 years ago
by
Dominique Marcadet
Browse files
Options
Downloads
Patches
Plain Diff
add the option to use colored output
parent
54eb5e1a
No related branches found
No related tags found
1 merge request
!10
Resolve "add warning level option on the command line"
Pipeline
#1246
passed
5 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fr.centralesupelec.edf.riseclipse.iec61850.scl.tools/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/RiseClipseValidatorSCL.java
+17
-7
17 additions, 7 deletions
...clipse/iec61850/scl/validator/RiseClipseValidatorSCL.java
with
17 additions
and
7 deletions
fr.centralesupelec.edf.riseclipse.iec61850.scl.tools/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/RiseClipseValidatorSCL.java
+
17
−
7
View file @
0d5bd596
...
...
@@ -57,12 +57,12 @@ public class RiseClipseValidatorSCL {
private
static
boolean
oclValidation
=
false
;
private
static
boolean
nsdValidation
=
false
;
@NonNull
private
static
final
IRiseClipseConsole
console
=
new
TextRiseClipseConsole
()
;
@NonNull
private
static
IRiseClipseConsole
console
;
private
static
void
usage
()
{
console
.
setLevel
(
IRiseClipseConsole
.
INFO_LEVEL
);
console
.
info
(
"java -jar RiseClipseValidatorSCL.jar [--info | --warning | --verbose] [--make-explicit-links] [<oclFile> | <nsdFile> | <sclFile>]*"
);
"java -jar RiseClipseValidatorSCL.jar [--info | --warning | --verbose] [--make-explicit-links]
[--use-color]
[<oclFile> | <nsdFile> | <sclFile>]*"
);
console
.
info
(
"Files ending with \".ocl\" are considered OCL files, "
+
"files ending with \\\".nsd\\\" are considered NSD files, "
+
"all others are considered SCL files"
);
...
...
@@ -74,33 +74,43 @@ public class RiseClipseValidatorSCL {
if
(
args
.
length
==
0
)
usage
();
boolean
makeExplicitLinks
=
false
;
boolean
useColor
=
false
;
boolean
displayCopyright
=
true
;
int
consoleLevel
=
IRiseClipseConsole
.
WARNING_LEVEL
;
int
posFiles
=
0
;
for
(
int
i
=
0
;
i
<
args
.
length
;
++
i
)
{
if
(
args
[
i
].
startsWith
(
"--"
)
)
{
posFiles
=
i
+
1
;
if
(
"--info"
.
equals
(
args
[
i
]
)
)
{
console
.
set
Level
(
IRiseClipseConsole
.
INFO_LEVEL
)
;
consoleLevel
=
IRiseClipseConsole
.
INFO_LEVEL
;
}
else
if
(
"--warning"
.
equals
(
args
[
i
]
)
)
{
console
.
set
Level
(
IRiseClipseConsole
.
WARNING_LEVEL
)
;
consoleLevel
=
IRiseClipseConsole
.
WARNING_LEVEL
;
}
else
if
(
"--verbose"
.
equals
(
args
[
i
]
)
)
{
console
.
set
Level
(
IRiseClipseConsole
.
VERBOSE_LEVEL
)
;
consoleLevel
=
IRiseClipseConsole
.
VERBOSE_LEVEL
;
}
else
if
(
"--make-explicit-links"
.
equals
(
args
[
i
]
)
)
{
makeExplicitLinks
=
true
;
}
else
if
(
"--use-color"
.
equals
(
args
[
i
]
)
)
{
useColor
=
true
;
}
else
if
(
"--do-not-display-copyright"
.
equals
(
args
[
i
]
)
)
{
displayCopyright
=
false
;
}
else
{
console
=
new
TextRiseClipseConsole
(
useColor
);
console
.
error
(
"Unrecognized option "
+
args
[
i
]
);
usage
();
}
}
}
console
=
new
TextRiseClipseConsole
(
useColor
);
console
.
setLevel
(
consoleLevel
);
if
(
displayCopyright
)
{
int
level
=
console
.
setLevel
(
IRiseClipseConsole
.
INFO_LEVEL
);
...
...
@@ -232,7 +242,7 @@ public class RiseClipseValidatorSCL {
List
<
?
>
data
=
childDiagnostic
.
getData
();
EObject
object
=
(
EObject
)
data
.
get
(
0
);
if
(
data
.
size
()
==
1
)
{
console
.
error
(
"\t"
+
childDiagnostic
.
getMessage
()
);
console
.
error
(
childDiagnostic
.
getMessage
()
);
}
else
if
(
data
.
get
(
1
)
instanceof
EAttribute
)
{
EAttribute
attribute
=
(
EAttribute
)
data
.
get
(
1
);
...
...
@@ -242,7 +252,7 @@ public class RiseClipseValidatorSCL {
+
childDiagnostic
.
getChildren
().
get
(
0
).
getMessage
()
);
}
else
{
console
.
error
(
"\t"
+
childDiagnostic
.
getMessage
()
);
console
.
error
(
childDiagnostic
.
getMessage
()
);
}
}
}
...
...
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