1234567891011121314151617181920212223242526272829303132333435363738394041(**************************************************************************)(* *)(* 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.V2openEZCMD.TYPESletcmd_name="fmt"letaction~args~auto_promote()=let(_p:Types.project)=Build.build~dev_deps:true~build:false~args()inMisc.before_hook"fmt";Misc.call(Array.of_list(["opam";"exec";"--";"dune";"build";"@fmt"]@ifauto_promotethen["--auto-promote"]else[]));Misc.after_hook"fmt";()letcmd=letauto_promote=reffalseinletargs,specs=Build.build_args()inEZCMD.subcmd_name(fun()->action~args~auto_promote:!auto_promote())~args:([(["auto-promote"],Arg.Setauto_promote,EZCMD.info"Promote detected changes immediately")]@specs)~doc:"Format sources with ocamlformat"