Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- open Arg
- let main () =
- let cmds = [( "-a", Arg.String (fun str -> ()), "do stuff") ] in
- Arg.parse cmds (fun str -> ()) "UsageMsg"
- let () = main ()
- (* generates this output:
- $ ocamlbuild my_prog.native; ./my_prog.native -a
- Finished, 4 targets (0 cached) in 00:00:00.
- ./my_prog.native: option '-a' needs an argument.
- UsageMsg
- -a do stuff
- -help Display this list of options
- --help Display this list of options
- ./my_prog.native: ./my_prog.native: option '-a' needs an argument.
- UsageMsg
- -a do stuff
- -help Display this list of options
- --help Display this list of options
- .
- UsageMsg
- -a do stuff
- -help Display this list of options
- --help Display this list of options
- *)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement