123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105(************************************************************************)(* Flèche => document manager: Document *)(* Copyright 2019 MINES ParisTech -- Dual License LGPL 2.1 / GPL3+ *)(* Copyright 2019-2024 Inria -- Dual License LGPL 2.1 / GPL3+ *)(* Written by: Emilio J. Gallego Arias & coq-lsp contributors *)(************************************************************************)openCmdliner(****************************************************************************)(* Common Coq command-line arguments *)letcoqlib=letdoc="Load Coq.Init.Prelude from $(docv); theories and user-contrib should live \
there."inArg.(value&optstringCoq_config.coqlib&info["coqlib"]~docv:"COQLIB"~doc)letcoqcorelib=letdoc="Path to Coq plugin directories."inArg.(value&optstring(Filename.concatCoq_config.coqlib"../coq-core/")&info["coqcorelib"]~docv:"COQCORELIB"~doc)letocamlpath=letdoc="Path to OCaml's lib"inArg.(value&opt(somestring)None&info["ocamlpath"]~docv:"OCAMLPATH"~doc)letcoq_lp_conv~implicit(unix_path,lp)={Loadpath.coq_path=Libnames.dirpath_of_stringlp;unix_path;has_ml=true;implicit;recursive=true}letrload_paths:Loadpath.vo_pathlistTerm.t=letdoc="Bind a logical loadpath LP to a directory DIR and implicitly open its \
namespace."inTerm.(constList.(map(coq_lp_conv~implicit:true))$Arg.(value&opt_all(pairdirstring)[]&info["R";"rec-load-path"]~docv:"DIR,LP"~doc))letqload_paths:Loadpath.vo_pathlistTerm.t=letdoc="Bind a logical loadpath LP to a directory DIR"inTerm.(constList.(map(coq_lp_conv~implicit:false))$Arg.(value&opt_all(pairdirstring)[]&info["Q";"load-path"]~docv:"DIR,LP"~doc))letdebug:boolTerm.t=letdoc="Enable debug mode"inArg.(value&flag&info["debug"]~doc)letbt=letdoc="Enable backtraces"inCmdliner.Arg.(value&flag&info["bt"]~doc)letml_include_path:stringlistTerm.t=letdoc="Include DIR in default loadpath, for locating ML files"inArg.(value&opt_alldir[]&info["I";"ml-include-path"]~docv:"DIR"~doc)letri_from:(stringoption*string)listTerm.t=letdoc="FROM Require Import LIBRARY before creating the document, à la From Coq \
Require Import Prelude"inTerm.(const(List.map(fun(x,y)->(Somex,y)))$Arg.(value&opt_all(pairstringstring)[]&info["rifrom";"require-import-from"]~docv:"FROM,LIBRARY"~doc))letint_backend=letdoc="Select Interruption Backend, if absent, the best available for your OCaml \
version will be selected"inArg.(value&opt(enum[("Coq",SomeLimits.Coq);("Mp",SomeLimits.Mp)])None&info["int_backend"]~docv:"INT_BACKEND"~doc)letroots:stringlistTerm.t=letdoc="Workspace(s) root(s)"inArg.(value&opt_allstring[]&info["root"]~docv:"ROOTS"~doc)letcoq_diags_level:intTerm.t=letdoc="Controsl whether Coq Info and Notice message appear in diagnostics.\n\
\ 0 = None; 1 = Notices, 2 = Notices and Info"inArg.(value&optint0&info["diags_level"]~docv:"DIAGS_LEVEL"~doc)