A little library for parsing command-line args in OCaml
OCaml
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
META
Makefile
README.md
aerger.ml
aerger.mli
test.ml

README.md

A little library for parsing command-line args.

let awesomeness, is_fast, color = Aerger.(
  with_usage "demo --awesomeness=99 -c BLUE --go_faster" (fun _ ->
    require (float ~names:["awesomeness"] ~desc:"How awesome to be" ~default:11.),
    require (bool ["go_faster"]),
    match get (enum ["c"; "color"] ["RED"; "GREEN"; "BLUE"]) with | Some color -> color | None -> "unspecified"
  )
) in

Printf.printf "fast? %b\nawesomeness: %f\ncolor: %s\n" is_fast awesomeness color;
List.iter print_endline (Aerger.rest ())