2020-12-27 15:46:11 +01:00
|
|
|
(* Type
|
2020-12-27 16:36:25 +01:00
|
|
|
*
|
2020-12-27 15:46:11 +01:00
|
|
|
* #+NAME:type *)
|
|
|
|
|
|
|
|
(* [[file:../command_line.org::type][type]] *)
|
|
|
|
type short_opt = char
|
2020-12-27 16:36:25 +01:00
|
|
|
type long_opt = string
|
|
|
|
type optional = Mandatory | Optional
|
2020-12-27 15:46:11 +01:00
|
|
|
type documentation = string
|
|
|
|
type argument = With_arg of string | Without_arg | With_opt_arg of string
|
|
|
|
|
|
|
|
type description = {
|
|
|
|
short: short_opt ;
|
|
|
|
long : long_opt ;
|
|
|
|
opt : optional ;
|
|
|
|
doc : documentation ;
|
|
|
|
arg : argument ;
|
|
|
|
}
|
|
|
|
(* type ends here *)
|
|
|
|
|
|
|
|
(* [[file:../command_line.org::*Mutable attributes][Mutable attributes:2]] *)
|
|
|
|
val set_header_doc : string -> unit
|
|
|
|
val set_description_doc : string -> unit
|
|
|
|
val set_footer_doc : string -> unit
|
|
|
|
(* Mutable attributes:2 ends here *)
|
|
|
|
|
|
|
|
(* [[file:../command_line.org::*Mutable attributes][Mutable attributes:4]] *)
|
|
|
|
val anonymous : long_opt -> optional -> documentation -> description
|
|
|
|
(* Mutable attributes:4 ends here *)
|
|
|
|
|
2020-12-27 17:38:04 +01:00
|
|
|
(* ~anon_args~ *)
|
2020-12-27 15:46:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
(* [[file:../command_line.org::*~anon_args~][~anon_args~:1]] *)
|
|
|
|
val anon_args : unit -> string list
|
|
|
|
(* ~anon_args~:1 ends here *)
|
|
|
|
|
2020-12-27 17:38:04 +01:00
|
|
|
(* ~get~ *)
|
2020-12-27 15:46:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
(* [[file:../command_line.org::*~get~][~get~:1]] *)
|
|
|
|
val get : long_opt -> string option
|
|
|
|
(* ~get~:1 ends here *)
|
|
|
|
|
2020-12-27 17:38:04 +01:00
|
|
|
(* ~get_bool~ *)
|
2020-12-27 15:46:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
(* [[file:../command_line.org::*~get_bool~][~get_bool~:1]] *)
|
|
|
|
val get_bool : long_opt -> bool
|
|
|
|
(* ~get_bool~:1 ends here *)
|
|
|
|
|
2020-12-27 17:38:04 +01:00
|
|
|
(* Specification *)
|
2020-12-27 15:46:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
(* [[file:../command_line.org::*Specification][Specification:1]] *)
|
|
|
|
val set_specs : description list -> unit
|
|
|
|
(* Specification:1 ends here *)
|