1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950typeplugins=unitCmdliner.Cmd.tQueue.tletplugins=Queue.create()letregistercmd=Queue.addcmdpluginsletfold=Queue.foldletget_channel=functionNone->stdout|Somepath->open_outpathletget_out_formatters=get_channels|>Format.formatter_of_out_channelopenCmdlinerletsetup_log=letinitstyle_renderer=Fmt_tty.setup_std_outputs?style_renderer()inTerm.(constinit$Fmt_cli.style_renderer())letinclude_=Arg.(value&opt(somestring)None&info["i";"include"]~docv:"MODULE"~doc:"Include MODULE in the generated code.")letoutput_file=letparses=matchSys.is_directoryswith|true->Error(`Msg(Fmt.str"Error: `%s' is a directory"s))|false|(exceptionSys_error_)->Ok(Somes)inArg.(value&opt(conv~docv:"OUTPUT"(parse,Fmt.(optionstring)))None&info["o";"output"]~absent:"stdout"~docv:"OUTPUT"~doc:"Print the generated code in OUTPUT. Overwrite the file if it exists.")letquiet=Arg.(value&flag&info["q";"quiet"]~doc:"Don't print any warnings.")letocaml_file=letparses=matchSys.file_existsswith|true->ifSys.is_directorys||Filename.extensions<>".mli"then`Error(Fmt.str"Error: `%s' is not an OCaml interface file"s)else`Oks|false->`Error(Fmt.str"Error: `%s' not found"s)inArg.(required&pos0(some(parse,Fmt.string))None&info[]~docv:"FILE"~doc:"Read Gospel specifications in FILE.")