You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 7578 Reporter: Richard-Degenne Assigned to:@Octachron Status: resolved (set by @Octachron on 2017-07-03T14:23:48Z) Resolution: duplicate Priority: normal Severity: minor Version: 4.04.2 Fixed in version: 4.05.0 +dev/beta1/beta2/beta3/rc1 Category: standard library Duplicate of:#7523
Bug description
When using the Arg module, a missing argument will trigger an error.
However, the error message is printed 3 times in a row instead of only once.
Note : I tried the same piece of code with 4.03.0 and 4.02.3, and was unable to reproduce.
Steps to reproduce
With OCaml 4.04.2,
Create a file cli.ml containing the following:
(* cli.ml *)
let usage = "usage: " ^ Sys.argv.(0) ^ " [-d int]"
let speclist = [
("-d", Arg.Set_int someint, ": some int parameter");
]
let () =
Arg.parse
speclist
(fun x -> raise (Arg.Bad ("Bad argument : " ^ x)))
usage;
Printf.printf "%d\n" !someint
Run with $ ocaml cli.ml -d (note the missing argument after -d)
Look at the error message:
cli.ml: option '-d' needs an argument.
usage: cli.ml [-d int]
-d : some int parameter
-help Display this list of options
--help Display this list of options
cli.ml: cli.ml: option '-d' needs an argument.
usage: cli.ml [-d int]
-d : some int parameter
-help Display this list of options
--help Display this list of options
.
usage: cli.ml [-d int]
-d : some int parameter
-help Display this list of options
--help Display this list of options
```g
The text was updated successfully, but these errors were encountered:
Original bug ID: 7578
Reporter: Richard-Degenne
Assigned to: @Octachron
Status: resolved (set by @Octachron on 2017-07-03T14:23:48Z)
Resolution: duplicate
Priority: normal
Severity: minor
Version: 4.04.2
Fixed in version: 4.05.0 +dev/beta1/beta2/beta3/rc1
Category: standard library
Duplicate of: #7523
Bug description
When using the
Arg
module, a missing argument will trigger an error.However, the error message is printed 3 times in a row instead of only once.
Note : I tried the same piece of code with 4.03.0 and 4.02.3, and was unable to reproduce.
Steps to reproduce
With OCaml 4.04.2,
cli.ml
containing the following:Run with
$ ocaml cli.ml -d
(note the missing argument after -d)Look at the error message:
The text was updated successfully, but these errors were encountered: