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: 122 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
I think I have found a small bug with the command line argument handling.
OCaml 3.00 shifts the Sys.argv command line arguments when invoked as
script:
ocaml a0 a1 ...
The script sees Sys.argv.(0) = ""; Sys.argv.(1) = a0 etc.
Well done. But Arg.current is not adjusted; it contains still the
number of already parsed arguments (here, !Arg.current = 1). I think
that Arg.current must be re-initialized to 0 after the arguments have
been shifted, otherwise the first argument(s) will be skipped if the
Arg module is used to parse the remaining arguments. In this example,
a1 is the first argument which is parsed by Arg.
Gerd
The text was updated successfully, but these errors were encountered:
I think I have found a small bug with the command line argument handling.
OCaml 3.00 shifts the Sys.argv command line arguments when invoked as
script:
ocaml a0 a1 ...
The script sees Sys.argv.(0) = ""; Sys.argv.(1) = a0 etc.
Well done. But Arg.current is not adjusted; it contains still the
number of already parsed arguments (here, !Arg.current = 1). I think
that Arg.current must be re-initialized to 0 after the arguments have
been shifted, otherwise the first argument(s) will be skipped if the
Arg module is used to parse the remaining arguments. In this example,
a1 is the first argument which is parsed by Arg.
Thank you for your accurate correction.
This will be changed immediately.
Original bug ID: 122
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Gerd Stolpmann
Version: Ocaml 3.00
OS:
Submission from: p3e9c36be.dip0.t-ipconnect.de (62.156.54.190)
Hi,
I think I have found a small bug with the command line argument handling.
OCaml 3.00 shifts the Sys.argv command line arguments when invoked as
script:
ocaml a0 a1 ...
The script sees Sys.argv.(0) = ""; Sys.argv.(1) = a0 etc.
Well done. But Arg.current is not adjusted; it contains still the
number of already parsed arguments (here, !Arg.current = 1). I think
that Arg.current must be re-initialized to 0 after the arguments have
been shifted, otherwise the first argument(s) will be skipped if the
Arg module is used to parse the remaining arguments. In this example,
a1 is the first argument which is parsed by Arg.
Gerd
The text was updated successfully, but these errors were encountered: