Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000122OCamlOCaml generalpublic2000-05-20 23:132000-05-24 03:36
Reporteradministrator 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000122: Command line arguments
DescriptionFull_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 <scriptname> a0 a1 ...

The script sees Sys.argv.(0) = "<scriptname>"; 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

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0000393)
administrator (administrator)
2000-05-22 03:01

> Full_Name: Gerd Stolpmann
>
> 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 <scriptname> a0 a1 ...
>
> The script sees Sys.argv.(0) = "<scriptname>"; 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.

    Jacques
(0000394)
administrator (administrator)
2000-05-24 03:36

Fixed on 2000-05-22 by Jacques

- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker