package genspio

  1. Overview
  2. Docs

Make scripts that provide a "--describe" option/command.

The two functions provided can be used like this:

let open Command_line in
let opts =
  let open Arg in
  flag ["--all"; "-a"] ~doc:"Kill everything, incl. the Screen session"
  & describe_option_and_usage ()
in
let kills = tmp_file "kill-list" in
parse opts (fun ~anon kill_em_all describe ->
    deal_with_describe describe
      [ if_seq kill_em_all

See also the Service Composer Example which is where the above snippet comes from.

Parameters

module P : sig ... end

Signature

val name : string
val description : string
val describe_option_and_usage : ?more_usage:string list -> unit -> (bool t -> 'a, 'a) Command_line.cli_options

Provide the "--describe" command line option.

val deal_with_describe : bool t -> unit t list -> unit t

Deal with the parsed result of the "--describe" option.

OCaml

Innovation. Community. Security.