Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sasa
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
Show more breadcrumbs
verimag
synchrone
sasa
Commits
b1bf334f
Commit
b1bf334f
authored
5 years ago
by
erwan
Browse files
Options
Downloads
Patches
Plain Diff
Chore: re-phrase the help messages
parent
a622266e
No related branches found
Branches containing commit
Tags
2.15.0
Tags containing commit
No related merge requests found
Pipeline
#35951
passed
5 years ago
Stage: build
Stage: deploy
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tools/ggDeco/ggDeco_Arg.ml
+58
-58
58 additions, 58 deletions
tools/ggDeco/ggDeco_Arg.ml
tools/graphgen/graphGen_arg.ml
+38
-37
38 additions, 37 deletions
tools/graphgen/graphGen_arg.ml
tools/readme.org
+6
-0
6 additions, 0 deletions
tools/readme.org
with
102 additions
and
95 deletions
tools/ggDeco/ggDeco_Arg.ml
+
58
−
58
View file @
b1bf334f
...
...
@@ -18,7 +18,9 @@ type t = {
}
let
usage_msg
tool
=
(
"usage: "
^
tool
^
" <algoFiles>... <file> [-o <file>]
\n
"
)
(
"usage: "
^
tool
^
"
\"
<decoration pattern>
\"
<input-file.dot> [option]*
decorates an <input-file.dot> using a <decoration pattern>.
"
)
let
print_usage
tool
=
Printf
.
printf
"
\n
%s use -h for additional information.
\n\n
"
(
usage_msg
tool
);
flush
stdout
;
exit
1
...
...
@@ -78,28 +80,27 @@ let printSpec args outChannel (c, messageList) = (
let
help
args
tool
=
(
Printf
.
printf
"
\n
"
;
Printf
.
printf
"%s"
(
usage_msg
tool
);
Printf
.
printf
"
\n
"
;
Printf
.
printf
"Add or replace the 'algo' label in the dot file, to change the algorithms attached to each node.
\n
"
;
Printf
.
printf
"<file> is the dot file on which you wish to change the algo.
\n
"
;
Printf
.
printf
"<algo-files> describe which nodes will have which algo attached to them. The syntax is the following :
\n
"
;
Printf
.
printf
"
\n
"
;
Printf
.
printf
" - To assign a file (containing an algo) to one node, write 'i:file', 'i' being the index of the node
\n
"
;
Printf
.
printf
" and 'file' being the file of the algo.
\n
"
;
Printf
.
printf
"
\n
"
;
Printf
.
printf
" - To assign a file to multiple nodes, write 'i-j:file', with 'i' being the index of the first node,
\n
"
;
Printf
.
printf
" 'j' being the last node's index (included) and 'file' being the file of the algo.
\n
"
;
Printf
.
printf
" Note : write 'i-:file' to assign the file to all nodes from i.
\n
"
;
Printf
.
printf
"
\n
"
;
Printf
.
printf
" - Concatenate all the the descriptions, with a whitespace between each.
\n
"
;
Printf
.
printf
" Example :
\"
1:root.ml 2-:p.ml
\"
assign root.ml to the first node, and p.ml to the other ones.
\n
"
;
(* maybe I should change it such that it accepts with or without the double quotes *)
Printf
.
printf
"
\n
"
;
Printf
.
printf
"
\n
"
;
Printf
.
printf
"============ Available Options ============
\n\n
"
;
(
List
.
iter
(
printSpec
args
stdout
)
(
List
.
rev
args
._
general_man
)
);
Printf
.
printf
"
\n
"
;
Printf
.
printf
"
<decoration pattern> specify which algos should be attached to which nodes.
Nodes ids are supposed to be consecutive strictly positive integers.
The <decoration pattern> syntax (in EBNF) is:
<decoration pattern> ::= <deco><more>
<deco> ::=
| <int>:<string>
| <int>-<int>:<string>
| <int>-:<string>
<more> ::= ([
\\
t]*<deco>)*
\"
i:file
\"
attaches <file> to node <i>
\"
i-j:file
\"
attaches <file> to nodes <i>, <i>+1, ..., <j>
\"
i-:file
\"
attaches <file> to nodes <i>, <i>+1, ..., <the last node>
Example: the decoration pattern
\"
1:root.ml 2-:p.ml
\"
assigns
\"
root.ml
\"
to the first node, and
\"
p.ml
\"
to the other ones.
[option] are:
"
;
List
.
iter
(
printSpec
args
stdout
)
(
List
.
rev
args
._
general_man
);
exit
0
)
...
...
@@ -114,15 +115,13 @@ let mkopt : t -> string list -> ?arg:string -> Arg.spec -> (string list -> unit)
(*** User Options Tab **)
let
(
mkoptab
:
string
array
->
t
->
unit
)
=
fun
argv
args
->
(
mkopt
args
[
"--output"
;
"-o"
]
~
arg
:
" <file>"
(
Arg
.
String
(
fun
s
->
args
.
output
<-
s
))
[
"Set the output file to the given file.
\n
"
];
[
"Redirect stdout into a <file>"
];
mkopt
args
[
"--help"
;
"-h"
]
(
Arg
.
Unit
(
fun
()
->
help
args
argv
.
(
0
)
))
[
"Print
s
this help
\n
"
];
[
"Print this help
\n
"
];
)
(* all unrecognized options are accumulated *)
...
...
@@ -136,38 +135,39 @@ let parse_file_spec : (string list -> files_spec_t list) =
fun
s
->
List
.
map
(
fun
file
->
try
(
Scanf
.
sscanf
file
"%[-0-9]:%s"
(
fun
range
file
->
if
range
=
""
then
raise
(
Invalid_file_spec
(
file
,
"The first and last node's indexes are missing"
))
else
Scanf
.
sscanf
range
"%d%s"
(
fun
a
s
->
if
(
a
<
0
)
then
raise
(
Invalid_file_spec
(
file
,
"The first node's index have to be positive or null"
))
else
if
(
s
=
""
)
then
(
a
,
a
,
file
)
else
if
(
s
=
"-"
)
then
(
a
,-
1
,
file
)
else
Scanf
.
sscanf
s
"-%d"
(
fun
b
->
if
(
b
<
a
)
then
raise
(
Invalid_file_spec
(
file
,
"The last node's index have to be higher than the first node's index"
))
else
(
a
,
b
,
file
)
)
)
)
)
with
|
Scanf
.
Scan_failure
_
->
try
(
Scanf
.
sscanf
file
"%[-0-9]:%s"
(
fun
range
file
->
if
range
=
""
then
raise
(
Invalid_file_spec
(
file
,
"The first and last node's indexes are \
missing"
))
else
Scanf
.
sscanf
range
"%d%s"
(
fun
a
s
->
if
(
a
<
0
)
then
raise
(
Invalid_file_spec
(
file
,
"The first node's index have to be positive or null"
))
else
if
(
s
=
""
)
then
(
a
,
a
,
file
)
else
if
(
s
=
"-"
)
then
(
a
,-
1
,
file
)
else
Scanf
.
sscanf
s
"-%d"
(
fun
b
->
if
(
b
<
a
)
then
raise
(
Invalid_file_spec
(
file
,
"The last node's index have to be higher than the first node's index"
))
else
(
a
,
b
,
file
)
)
)
)
)
with
|
Scanf
.
Scan_failure
_
->
raise
(
Invalid_file_spec
(
file
,
"The boundaries (first and last node's indexes) should be integers, but an non-numerical character has been found"
))
Invalid_file_spec
(
file
,
"The boundaries (first and last node's indexes) should be integers, but an non-numerical character has been found"
))
)
s
let
rec
pop
l
=
(* last ? *)
...
...
This diff is collapsed.
Click to expand it.
tools/graphgen/graphGen_arg.ml
+
38
−
37
View file @
b1bf334f
...
...
@@ -42,53 +42,54 @@ type t = {
mutable
_margin
:
int
;
}
let
usage_msg
do_print_command
tool
=
if
do_print_command
then
let
usage_msg
do_print_command
tool
=
"gg is an experimental graph generator.
\n
"
^
(
if
do_print_command
then
(
"usage: "
^
tool
^
" <command> [options]
\n
"
)
else
(
"usage: "
^
tool
^
" [options]
\n
"
)
(
"usage: "
^
tool
^
" [options]
\n
"
)
)
let
print_usage
output
do_print_command
tool
=
Printf
.
fprintf
output
"%s%s"
(
usage_msg
do_print_command
tool
)
(
if
(
do_print_command
)
then
Printf
.
fprintf
output
"%s%s"
(
usage_msg
do_print_command
tool
)
(
if
(
do_print_command
)
then
"use -h to see the available commands.
\n\n
"
else
"use -h to see available options.
\n
"
)
)
let
(
make_args
:
unit
->
t
)
=
fun
()
->
{
outputFile
=
""
;
dotUDG
=
""
;
dotUDGrad
=
""
;
action
=
"void"
;
n
=
-
1
;
grid
=
{
width
=
0
;
height
=
0
;
};
er
=
0
.
3
;
ba
=
2
;
qudg
=
{
width
=
10
.;
height
=
10
.;
radius
=
3
.;
r1
=
2
.;
p
=
0
.
5
;
};
attr
=
[]
;
silent
=
false
;
directed
=
false
;
_args
=
[]
;
_man
=
[]
;
_others
=
[]
;
_margin
=
12
;
}
{
outputFile
=
""
;
dotUDG
=
""
;
dotUDGrad
=
""
;
action
=
"void"
;
n
=
-
1
;
grid
=
{
width
=
0
;
height
=
0
;
};
er
=
0
.
3
;
ba
=
2
;
qudg
=
{
width
=
10
.;
height
=
10
.;
radius
=
3
.;
r1
=
2
.;
p
=
0
.
5
;
};
attr
=
[]
;
silent
=
false
;
directed
=
false
;
_args
=
[]
;
_man
=
[]
;
_others
=
[]
;
_margin
=
12
;
}
let
first_line
b
=
(
try
(
...
...
This diff is collapsed.
Click to expand it.
tools/readme.org
0 → 100644
+
6
−
0
View file @
b1bf334f
Some experimental but yet useful tools by Nathan Rébiscoul and Gwennan
Eliezer (undergraduate trainees).
- =gg= is a dot graph generator.
- =gg-deco= decorates graphs generated by =gg=
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