Skip to content

Commit bb6d201

Browse files
committed
beautify command line interface
1 parent 36658aa commit bb6d201

File tree

2 files changed

+11
-24
lines changed

2 files changed

+11
-24
lines changed

driver/Driver.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ let translate fn=
218218

219219
let parse_command () =
220220
if (Array.length Sys.argv)=1 then
221-
print_string usage_msg
221+
Arg.usage (Arg.align options) usage_msg
222222
else
223223
Arg.parse (Arg.align options) translate usage_msg;;
224224

driver/Options.ml

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,6 @@ let usage_msg="\
2020
USAGE: l2c [options] <source.ast>
2121
2222
options:
23-
-save-temp: Save temporary intermediate files
24-
-coq-parser: Validated parser by coq
25-
-ctemp: Output ctemp source
26-
-print-parse: Print parse output
27-
-target_dir <dir>: Set the directory of target files to <dir>
28-
-display <file>: Set the gui specification of l2c display mode
29-
-print-display: Print parsed display model
30-
-o <file>: Indicate the output file name
31-
-version: Print version information
32-
-help: Print this usage message
33-
3423
";;
3524

3625
let flag_save_temp = ref false;;
@@ -43,16 +32,14 @@ let display_file = ref "";;
4332
let flag_print_display = ref false;;
4433

4534
let options = [
46-
("-save-temp", Set flag_save_temp, "Save temporary immediate files");
47-
("-coq-parser", Set flag_coq_parser, "Validated parser by coq");
48-
("-ctemp", Set flag_ctemp, "Output ctemp source");
49-
("-print-parse", Set flag_print_parse, "Print parse output");
50-
("-display", Set_string display_file, "The specification file of the l2c display mode");
51-
("-print-display", Set flag_print_display, "Print parsed output of display model");
52-
("-target_dir", Set_string target_dir, "The directory of generated target files");
53-
("-o", Set_string output_file, "Indicate the output file name");
54-
("-version", Unit (fun()->(print_string version_msg)), "Print version information");
55-
("-help", Unit (fun()->(print_string usage_msg)), "Print this usage message");
35+
("-save-temp", Set flag_save_temp, " Save temporary immediate files");
36+
("-coq-parser", Set flag_coq_parser, " Validated parser by coq");
37+
("-ctemp", Set flag_ctemp, " Output ctemp source");
38+
("-print-parse", Set flag_print_parse, " Print parse output");
39+
("-display", Set_string display_file, "<file> The specification file of the l2c display mode");
40+
("-print-display", Set flag_print_display, " Print parsed output of display model");
41+
("-target_dir", Set_string target_dir, "<dir> The directory of generated target files");
42+
("-o", Set_string output_file, "<file> Indicate the output file name");
43+
("-version", Unit (fun()->(print_string version_msg)), " Print version information");
44+
("-help", Unit (fun()->(print_string usage_msg)), " Print this usage message");
5645
];;
57-
58-

0 commit comments

Comments
 (0)