Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file unic_info.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195leterror_msgffmt=Fmt.kstr(funmsg->Error(`Msgmsg))fmtletshowquietlocation=matchUniq_info.vlocationwith|Okt->ifnotquietthenUniq_info.showFmt.stdoutt;`Ok0|Error(`Msgmsg)->ifquietthen`Ok1else`Error(false,Fmt.str"%s."msg)letsearchquietfiltersprefer_libraryrootsmodnamedigest=matchUniq_mod.search~filters~rootsmodnamedigestwith|Ok[]->`Ok1|Okmodules->letfn(_,m)=Uniq_info.is_a_libraryminletmodules=ifprefer_librarythenmatchList.filterfnmoduleswith|[]->modules|libraries->librarieselsemodulesinList.iter(fun(path,_)->Fmt.pr"%a\n%!"Fpath.pppath)modules;`Ok0|Error(`Msgmsg)->ifquietthen`Ok1else`Error(false,Fmt.str"%s."msg)openCmdlineropenUnic_cliletfile=letdoc="The OCaml object."inletparserstr=matchFpath.of_stringstrwith|Ok_asvwhenSys.file_existsstr&&Sys.is_directorystr=false->v|Okv->error_msgf"%a is not a file or does not exist"Fpath.ppv|Error_aserr->errinletexisting_file=Arg.conv(parser,Fpath.pp)inArg.(required&pos~rev:true0(someexisting_file)None&info[]~doc)letterm_show=letopenTerminret(constshow$setup_logs$file)letcmd_show=letdoc="Print information about an OCaml object."inletman=[`SManpage.s_description;`P"$(tname) reads an OCaml object (a $(b,.cmi), $(b,.cmo), $(b,.cmx), \
$(b,.cma) or $(b,.cmxa) file) and prints what the object exports and \
what it imports, with the digest of each module."]inCmd.v(Cmd.info"show"~doc~man)term_showletdirectories=letdoc="The directory containing the OCaml files."inletparserstr=matchFpath.of_stringstrwith|Ok_asvwhenSys.file_existsstr&&Sys.is_directorystr->v|Okv->error_msgf"%a is not a directory or does not exist"Fpath.ppv|Error_aserr->errinletopenArginvalue&opt_all(conv(parser,Fpath.pp))[]&info["I"]~doc~docv:"DIRECTORY"letmodpath=letdoc="The module name."inletparserstr=letp=String.split_on_char'.'strinletfnaccstr=match(acc,Modname.of_stringstr)with|(Error_aserr),_->err|_,(Error_aserr)->err|Okrpath,Okm->Ok(m::rpath)inlet(let*)=Result.bindinlet*lst=List.fold_leftfn(Ok[])pinletlst=List.revlstinOk(Uniq_info.Path.of_listlst)inletpp=Uniq_info.Path.ppinletv=Arg.conv(parser,pp)inletopenArginrequired&pos0(somev)None&info[]~doc~docv:"MODNAME"letdigest=letdoc="The $(i,digest) of the module."inletdigest=Arg.convUniq_digest.(of_string,pp)inletopenArginvalue&opt(somedigest)None&info["digest"]~doc~docv:"DIGEST"letkind_of_artifacts=letintf=letdoc="Select only interfaces."inletinfo=Arg.info["intf"]~docin(`Intf,info)inletimpl=letdoc="Select only implementations."inletinfo=Arg.info["impl"]~docin(`Impl,info)inletopenArginvalue&vflag`All[intf;impl]letkind_of_objects=letsources=letdoc="Select only source files."inletinfo=Arg.info["sources"]~docin(`Sources,info)inletobjects=letdoc="Select only object files."inletinfo=Arg.info["objects"]~docin(`Objects,info)inletopenArginvalue&vflag`All[sources;objects]lettarget=letnative=letdoc="Select only native objects."inletinfo=Arg.info["native"]~docin(`Native,info)inletbytecode=letdoc="Select only bytecode objects."inletinfo=Arg.info["bytecode"]~docin(`Bytecode,info)inletopenArginvalue&vflag`All[native;bytecode]letprefer_library=letdoc="Prefer libraries (.cma & .cmxa) instead of unit modules."inletopenArginvalue&flag&info["prefer-library"]~docletsetup_filterskind_artifactskind_objectstarget=(kind_artifacts,kind_objects,target)letsetup_filters=letopenTerminconstsetup_filters$kind_of_artifacts$kind_of_objects$targetletterm_search=letopenTerminretbeginconstsearch$setup_logs$setup_filters$prefer_library$setup_ocamlfind$modpath$digestendletcmd_search=letdoc="Search a module from a module name and a $(i,digest)."inletman=[`SManpage.s_description;`P"$(tname) searches, into the $(b,ocamlfind) directories, the OCaml \
objects which provide the given module. If a digest is given (see the \
$(b,--digest) option and $(b,unic digest)), only the objects which \
export the module with this digest are printed.";`P"Some filters are available to restrict the search to interfaces or \
implementations, to sources or objects, and to native or bytecode \
objects."]inCmd.v(Cmd.info"search"~doc~man)term_searchletcmd=letdoc="A tool to manipulate OCaml objects."inletman=[`SManpage.s_description;`P"$(tname) offers some tools to inspect OCaml objects: $(b,show) prints \
what an object exports and imports, and $(b,search) finds which \
objects provide a given module."]inletdefault=Term.(ret(const(`Help(`Pager,None))))inCmd.group~default(Cmd.info"info"~doc~man)[cmd_show;cmd_search]