Skip to content

Commit 1f03d90

Browse files
committed
printer nice error message
1 parent 96707b3 commit 1f03d90

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

jscomp/bsb_exe/rescript_main.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ let build_subcommand ~start argv argv_len =
136136
Always regenerate build.ninja no matter bsconfig.json is changed or \
137137
not" );
138138
("-no-deps", unit_set_spec no_deps_mode, "*internal* Needed for watcher to build without dependencies on file change");
139-
("-warn-error", string_call (fun s -> warning_as_error := Some s), "Enable warnings as error")
139+
("-warn-error", string_call (fun s -> warning_as_error := Some s), "Warning numbers and whether to turn it into error or not")
140140
|]
141141
failed_annon;
142142

@@ -148,7 +148,7 @@ let build_subcommand ~start argv argv_len =
148148
| _ ->
149149
let warn_as_error = match !warning_as_error with
150150
| Some s ->
151-
Warnings.parse_options true s;
151+
let () = try Warnings.parse_options true s with Arg.Bad msg -> Bsb_arg.bad_arg (msg ^ "\n") in
152152
Some s
153153
| None -> None in
154154
let config_opt =

jscomp/build_tests/cli_help/input.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const buildHelp =
3636
" -ws [host]:port set up host & port for WebSocket build notifications\n" +
3737
" -verbose Set the output to be verbose\n" +
3838
" -with-deps *deprecated* This is the default behavior now. This option will be removed in a future release\n" +
39-
" -warn-error Enable warnings as error\n";
39+
" -warn-error Warning numbers and whether to turn it into error or not\n";
4040

4141
const cleanHelp =
4242
"Usage: rescript clean <options>\n" +

0 commit comments

Comments
 (0)