diff --git a/bin/cli.ml b/bin/cli.ml index 016c79dd..e0d3b3c1 100644 --- a/bin/cli.ml +++ b/bin/cli.ml @@ -5,20 +5,12 @@ let () = open Cmdliner -let usage () = - Format.(fprintf err_formatter) - "@[ortac: required plugin is missing, please install at least one@ \ - (qcheck-stm,@ monolith@ or@ wrapper).@]@."; - exit Cmd.Exit.cli_error - let () = - match + let doc = "Run ORTAC." and version = "ortac version %%VERSION%%" in + let info = Cmd.info "ortac" ~doc ~version + and default = Term.(ret (const (`Help (`Pager, None)))) + and cmds = Registration.fold (fun acc cmd -> cmd :: acc) [] Registration.plugins - with - | [] -> usage () - | cmds -> - let doc = "Run ORTAC." in - let version = "ortac version %%VERSION%%" in - let info = Cmd.info "ortac" ~doc ~version in - let group = Cmd.group info cmds in - Stdlib.exit (Cmd.eval group) + in + let group = Cmd.group info ~default cmds in + Stdlib.exit (Cmd.eval group)