Source file b0_main.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
(*---------------------------------------------------------------------------
   Copyright (c) 2020 The b0 programmers. All rights reserved.
   Distributed under the ISC license, see terms at the end of the file.
  ---------------------------------------------------------------------------*)

open Cmdliner

let doc = "Software construction and deployment kit"
let sdocs = Manpage.s_common_options
let exits = B0_driver.Exit.infos
let man = [
  `S Manpage.s_synopsis;
  `P "$(mname) $(b,--) [$(i,ACTION)] [$(i,ARG)]…"; `Noblank;
  `P "$(mname) $(i,COMMAND) …";
  `S Manpage.s_description;
  `P "B0 describes software construction and deployments using modular and \
      customizable definitions written in OCaml.";
  `Pre "Use $(mname) $(b,unit) to see what can be built."; `Noblank;
  `Pre "Use $(mname) $(b,--what) to see what gets built."; `Noblank;
  `Pre "Use $(mname) to build."; `Noblank;
  `Pre "Use $(mname) $(b,-u) $(i,UNIT) to build $(i,UNIT)."; `Noblank;
  `Pre "Use $(mname) $(b,-p) $(i,PACK) to build pack $(i,PACK).";
  `Pre "Use $(mname) [$(i,COMMAND)]… $(b,--help) for help about any \
        command.";
  `P "More information is available in the manuals, see $(b,odig doc b0).";
  B0_b0.Cli.man_see_manual;
  `S Manpage.s_bugs;
  `P "Report them, see $(i,https://erratique.ch/software/b0) for contact information."; ]

let cmds =
  [ B0_cmd_build.cmd;
    B0_cmd_cmdlet.cmd;
    B0_cmd_cmd.cmd;
    B0_cmd_delete.cmd;
    B0_cmd_file.cmd;
    B0_cmd_list.cmd;
    B0_cmd_log.cmd;
    B0_cmd_pack.cmd;
    B0_cmd_root.cmd;
    B0_cmd_scope.cmd;
    B0_cmd_unit.cmd ]

let b0 =
  let info = Cmd.info "b0" ~version:"v0.0.5" ~doc ~sdocs ~exits ~man in
  Cmd.group info ~default:B0_cmd_build.term cmds

let main () = Cmd.eval_value b0
let () = B0_driver.set ~driver:B0_b0.driver ~main

(*---------------------------------------------------------------------------
   Copyright (c) 2020 The b0 programmers

   Permission to use, copy, modify, and/or distribute this software for any
   purpose with or without fee is hereby granted, provided that the above
   copyright notice and this permission notice appear in all copies.

   THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
   WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
   MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
   ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
   WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
   ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  ---------------------------------------------------------------------------*)