Skip to content

Commit

Permalink
Start to prepare for help generation
Browse files Browse the repository at this point in the history
  • Loading branch information
gridbugs committed Feb 29, 2024
1 parent dd6aca1 commit 79a0f3a
Show file tree
Hide file tree
Showing 5 changed files with 213 additions and 119 deletions.
5 changes: 5 additions & 0 deletions examples/dune
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@
(names group)
(libraries climate)
(modules group))

(executables
(names optional_args)
(libraries climate)
(modules optional_args))
10 changes: 10 additions & 0 deletions examples/optional_args.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
open Climate

let term =
let open Arg_parser in
let+ x = named_opt_with_default [ "x" ] string ~default:"foo"
and+ y = named_opt_with_default [ "y" ] string ~default:"bar" in
Printf.printf "%s and %s" x y
;;

let () = Command.singleton term |> Command.run
Loading

0 comments on commit 79a0f3a

Please sign in to comment.