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

wrong usage output in Arg.parse #8480

Closed
vicuna opened this issue Feb 8, 2004 · 2 comments
Closed

wrong usage output in Arg.parse #8480

vicuna opened this issue Feb 8, 2004 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Feb 8, 2004

Original bug ID: 2188
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: Heinz Deinhart
Version: Objective Caml version 3.07+2
OS: Linux (Redhat 7.x with src.rpm compiled)
Submission from: h081217015199.dyn.cm.kabsi.at (81.217.15.199)

There seems to be a problem in Arg.parse with the usage output in case of a
missing
argument for an option. Probably some problem with the buffer used in there?
It is quite simple to reproduce:

emp@ei:~/cvs.nix.at/Code/gemma> cat argbug.ml
let speclist = [
("-i", Arg.Int (fun i -> Printf.printf "int -i: %i\n" i), "a nice integer")
]
let anonfun s =
Printf.printf "anonfun called with: %s\n" s
let _ =
Arg.parse speclist anonfun "usage message\n";
exit 0

emp@ei:~/cvs.nix.at/Code/gemma> ocaml argbug.ml -x # this works
argbug.ml: unknown option `-x'.
usage message

-i a nice integer
-help Display this list of options
--help Display this list of options
emp@ei:/cvs.nix.at/Code/gemma> ocaml argbug.ml -i 10 # this works, too
int -i: 10
emp@ei:
/cvs.nix.at/Code/gemma> ocaml argbug.ml -i # this prints strange
msg
argbug.ml: option `-i' needs an argument.
usage message

-i a nice integer
-help Display this list of options
--help Display this list of options
argbug.ml: argbug.ml: option `-i' needs an argument.
usage message

-i a nice integer
-help Display this list of options
--help Display this list of options
.
usage message

-i a nice integer
-help Display this list of options
--help Display this list of options
emp@ei:~/cvs.nix.at/Code/gemma>

@vicuna
Copy link
Author

vicuna commented Feb 9, 2004

Comment author: administrator

Full_Name: Heinz Deinhart

There seems to be a problem in Arg.parse with the usage output in case of a
missing
argument for an option. Probably some problem with the buffer used in there?
It is quite simple to reproduce:

Thanks for the report. This is indeed a bug in 3.07+2, and it is already fixed
in
the CVS version.

-- Damien

@vicuna
Copy link
Author

vicuna commented Feb 9, 2004

Comment author: administrator

see #8372

@vicuna vicuna closed this as completed Feb 9, 2004
@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