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
It is easy enough to emulate this action except for the behavior of
the help message. Maybe you could supply a mechanism for customizing
the help message?
It would also be nice if the message for Arg.String and Arg.Int,
etc. mentions that the options takes an argument of the specified
type. This might make some of the messages a little less descriptive.
For example instead of
-cc Use as the C compiler and linker
it would now say
-cc string Use as the C compiler and linker
I know that in ocamlc you guys a real cool mechanism for the -w
feature but I'm not sure how to automate that.
I'm happy to write the code but I'm not sure if anyone is interested
in it. If you are send me a note and some of your requirements and
I'll go to town.
-cheers
The text was updated successfully, but these errors were encountered:
One feature that (I think) Module Arg could benefit by is more
descriptive and automated help. I'd like to have a
Arg.Symbol of (string * 'a) list * ('a -> unit)
I have tried to implement this, but it needs modifications. The compiler
complains that the type variable 'a is not bound. If I bind it as an
argument to the "spec" type, then we have two problems:
It is an incompatible change.
It forces all your Symbol options to use the same 'a type.
So what I have done is:
Arg.Symbol of string list * (string -> unit)
And it is your function that has to turn the string into whatever it
needs. One problem with this solution is that your list of symbols
will appear twice in the program (in your function, and in your spec
list).
Another way of doing things would be to give one function for each
symbol, like this:
Arg.Symbol of (string * (unit -> unit)) list
But I don't much like this solution, as it is really heavyweight.
If you have a better idea, please tell me.
Pretty much, but square brackets usually denote optional arguments,
so I have used curly braces.
Implemented in the current working version (3.06+14).
It would also be nice if the message for Arg.String and Arg.Int,
etc. mentions that the options takes an argument of the specified
type. This might make some of the messages a little less descriptive.
For example instead of
-cc Use as the C compiler and linker
it would now say
-cc string Use as the C compiler and linker
I don't like it much, but if you want your program to do it, you
can already do it: just write your documentation strings accordingly.
Original bug ID: 1200
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)
Bug description
Hi,
One feature that (I think) Module Arg could benefit by is more
descriptive and automated help. I'd like to have a
Arg.Symbol of (string * 'a) list * ('a -> unit)
such that when it is necessary to dump the help messages the
constructs
"-foobar", Arg.Symbol (["foo",Foo; "bar",Bar], foobar_handler, "foobar?");
"-sex", Arg.Symbol (["male",Male; "female",Female], sex_handler, "sex");
would print as
-foobar [foo|bar] foobar?
-sex [male|female] sex
It is easy enough to emulate this action except for the behavior of
the help message. Maybe you could supply a mechanism for customizing
the help message?
It would also be nice if the message for Arg.String and Arg.Int,
etc. mentions that the options takes an argument of the specified
type. This might make some of the messages a little less descriptive.
For example instead of
-cc Use as the C compiler and linker
it would now say
-cc string Use as the C compiler and linker
I know that in ocamlc you guys a real cool mechanism for the -w
feature but I'm not sure how to automate that.
I'm happy to write the code but I'm not sure if anyone is interested
in it. If you are send me a note and some of your requirements and
I'll go to town.
-cheers
The text was updated successfully, but these errors were encountered: