Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command line arguments #2463

Closed
vicuna opened this issue May 20, 2000 · 2 comments
Closed

Command line arguments #2463

vicuna opened this issue May 20, 2000 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented May 20, 2000

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

@vicuna
Copy link
Author

vicuna commented May 22, 2000

Comment author: administrator

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 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.

Jacques

@vicuna
Copy link
Author

vicuna commented May 24, 2000

Comment author: administrator

Fixed on 2000-05-22 by Jacques

@vicuna vicuna closed this as completed May 24, 2000
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant