1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950(**************************************************************************)(* *)(* Copyright 2020 OCamlPro & Origin Labs *)(* *)(* All rights reserved. This file is distributed under the terms of the *)(* GNU Lesser General Public License version 2.1, with the special *)(* exception on linking described in the file LICENSE. *)(* *)(**************************************************************************)openEzcmd.TYPESletcmd_name="run"letaction~args~cmd~package=decrGlobals.verbosity;(* By default, `drom run` should be quiet *)letp=Build.build~args()inletcmd=!cmdinletcmd=matchpackagewith|Somepackage->package::cmd|None->(matchp.package.kindwith|Library->cmd|Program->p.package.name::cmd|Virtual->cmd)inMisc.call(Array.of_list("opam"::"exec"::"--"::"dune"::"exec"::"--"::cmd))letcmd=letcmd=ref[]inletpackage=refNoneinletargs,specs=Build.build_args()in{cmd_name;cmd_action=(fun()->action~args~cmd~package:!package);cmd_args=[(["p"],Arg.String(funs->package:=Somes),Ezcmd.info"Package to run");([],Arg.Anons(funlist->cmd:=list),Ezcmd.info"Arguments to the command")]@specs;cmd_man=[];cmd_doc="Execute the project"}