The unpac monorepo manager self-hosting as a monorepo using unpac
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Rename Cmdliner_info.Cmd to Cmdliner_info.Cmd_info

+74 -69
+15 -14
vendor/opam/cmdliner/src/cmdliner_cmd.ml
··· 5 5 6 6 (* Commands *) 7 7 8 - type info = Cmdliner_info.Cmd.t 9 - let info = Cmdliner_info.Cmd.make 8 + type info = Cmdliner_info.Cmd_info.t 9 + let info = Cmdliner_info.Cmd_info.make 10 10 11 11 type 'a t = 12 12 | Cmd of info * 'a Cmdliner_term.parser 13 13 | Group of info * ('a Cmdliner_term.parser option * 'a t list) 14 14 15 - let make i t = 16 - let info = Cmdliner_info.Cmd.add_args i (Cmdliner_term.argset t) in 15 + let make info t = 16 + let info = Cmdliner_info.Cmd_info.add_args info (Cmdliner_term.argset t) in 17 17 Cmd (info, Cmdliner_term.parser t) 18 18 19 19 let v = make 20 20 21 - let get_info = function Cmd (i, _) | Group (i, _) -> i 21 + let get_info = function Cmd (info, _) | Group (info, _) -> info 22 22 let get_children_infos = function 23 23 | Cmd _ -> assert false | Group (_, (_, cs)) -> List.map get_info cs 24 24 25 - let group ?default i cmds = 25 + let group ?default info cmds = 26 26 let args, parser = match default with 27 27 | None -> None, None 28 28 | Some t -> Some (Cmdliner_term.argset t), Some (Cmdliner_term.parser t) 29 29 in 30 30 let children = List.map get_info cmds in 31 - let i = Cmdliner_info.Cmd.with_children i ~args ~children in 32 - Group (i, (parser, cmds)) 31 + let info = Cmdliner_info.Cmd_info.with_children info ~args ~children in 32 + Group (info, (parser, cmds)) 33 33 34 - let name c = Cmdliner_info.Cmd.name (get_info c) 34 + let name c = Cmdliner_info.Cmd_info.name (get_info c) 35 35 36 36 let name_trie cmds = 37 37 let add acc cmd = 38 - let i = get_info cmd in 39 - let name = Cmdliner_info.Cmd.name i in 38 + let info = get_info cmd in 39 + let name = Cmdliner_info.Cmd_info.name info in 40 40 match Cmdliner_trie.add acc name cmd with 41 41 | `New t -> t 42 42 | `Replaced (cmd', _) -> 43 - let i' = get_info cmd' and kind = "command" in 43 + let info' = get_info cmd' and kind = "command" in 44 44 invalid_arg @@ 45 - Cmdliner_base.err_multi_def ~kind name Cmdliner_info.Cmd.doc i i' 45 + Cmdliner_base.err_multi_def ~kind name 46 + Cmdliner_info.Cmd_info.doc info info' 46 47 in 47 48 List.fold_left add Cmdliner_trie.empty cmds 48 49 49 50 let list_names cmds = 50 - let cmd_name c = Cmdliner_info.Cmd.name (get_info c) in 51 + let cmd_name c = Cmdliner_info.Cmd_info.name (get_info c) in 51 52 List.sort String.compare (List.rev_map cmd_name cmds)
+1 -1
vendor/opam/cmdliner/src/cmdliner_cmd.mli
··· 5 5 6 6 (** Commands and their information. *) 7 7 8 - type info = Cmdliner_info.Cmd.t 8 + type info = Cmdliner_info.Cmd_info.t 9 9 10 10 val info : 11 11 ?deprecated:string -> ?man_xrefs:Cmdliner_manpage.xref list ->
+4 -4
vendor/opam/cmdliner/src/cmdliner_completion.ml
··· 26 26 27 27 let pp_opt_names ~err_ppf ~subst ~prefix ppf cmd = 28 28 let info = Cmdliner_cmd.get_info cmd in 29 - let set = Cmdliner_info.Cmd.args info in 29 + let set = Cmdliner_info.Cmd_info.args info in 30 30 if not (Cmdliner_info.Arg.Set.is_empty set) then begin 31 - let arg_infos = Cmdliner_info.Cmd.args info in 31 + let arg_infos = Cmdliner_info.Cmd_info.args info in 32 32 pp_group ppf "Options"; 33 33 Cmdliner_info.Arg.Set.iter (pp_opt ~err_ppf ~subst ~prefix ppf) arg_infos 34 34 end ··· 49 49 let pp_subcmds ~err_ppf ~subst ~prefix ppf cmd = 50 50 pp_group ppf "Subcommands"; 51 51 let complete_cmd cmd = 52 - let name = Cmdliner_info.Cmd.name cmd in 52 + let name = Cmdliner_info.Cmd_info.name cmd in 53 53 (* FIXME subst is wrong here. *) 54 - let doc = Cmdliner_info.Cmd.styled_doc ~errs:err_ppf ~subst cmd in 54 + let doc = Cmdliner_info.Cmd_info.styled_doc ~errs:err_ppf ~subst cmd in 55 55 pp_item ppf ~prefix (name, doc) 56 56 in 57 57 List.iter complete_cmd (Cmdliner_cmd.get_children_infos cmd)
+21 -21
vendor/opam/cmdliner/src/cmdliner_docgen.ml
··· 47 47 (* Command docs *) 48 48 49 49 let invocation ?(sep = " ") ?(ancestors = []) cmd = 50 - let names = List.rev_map Cmdliner_info.Cmd.name (cmd :: ancestors) in 50 + let names = List.rev_map Cmdliner_info.Cmd_info.name (cmd :: ancestors) in 51 51 esc @@ String.concat sep names 52 52 53 53 let synopsis_pos_arg a = ··· 74 74 then strf "$(b,%s)[=$(i,%s)]" (esc n) (esc var) 75 75 else strf "$(b,%s) [$(i,%s)]" (esc n) (esc var) 76 76 77 - let deprecated cmd = match Cmdliner_info.Cmd.deprecated cmd with 77 + let deprecated cmd = match Cmdliner_info.Cmd_info.deprecated cmd with 78 78 | None -> "" | Some _ -> "(Deprecated) " 79 79 80 80 let synopsis ?(show_help = false) ?ancestors cmd = 81 81 let show_help = if show_help then " [$(b,--help)]" else "" in 82 - match Cmdliner_info.Cmd.children cmd with 82 + match Cmdliner_info.Cmd_info.children cmd with 83 83 | [] -> 84 84 let rev_cli_order (a0, _) (a1, _) = 85 85 Cmdliner_info.Arg.rev_pos_cli_order a0 a1 86 86 in 87 - let args = Cmdliner_info.Cmd.args cmd in 87 + let args = Cmdliner_info.Cmd_info.args cmd in 88 88 let oargs, pargs = 89 89 Cmdliner_info.Arg.(Set.partition (fun a _ -> is_opt a) args) 90 90 in ··· 120 120 strf "%s$(b,%s)%s %s%s" 121 121 (deprecated cmd) (invocation ?ancestors cmd) show_help oargs pargs 122 122 | _cmds -> 123 - let subcmd = match Cmdliner_info.Cmd.has_args cmd with 123 + let subcmd = match Cmdliner_info.Cmd_info.has_args cmd with 124 124 | false -> "$(i,COMMAND)" | true -> "[$(i,COMMAND)]" 125 125 in 126 126 strf "%s$(b,%s)%s %s …" (deprecated cmd) (invocation ?ancestors cmd) 127 127 show_help subcmd 128 128 129 129 let cmd_doc cmd = 130 - let depr = match Cmdliner_info.Cmd.deprecated cmd with 130 + let depr = match Cmdliner_info.Cmd_info.deprecated cmd with 131 131 | None -> "" | Some msg -> msg ^ " " 132 132 in 133 - depr ^ Cmdliner_info.Cmd.doc cmd 133 + depr ^ Cmdliner_info.Cmd_info.doc cmd 134 134 135 - let cmd_docs ei = match Cmdliner_info.(Cmd.children (Eval.cmd ei)) with 135 + let cmd_docs ei = match Cmdliner_info.(Cmd_info.children (Eval.cmd ei)) with 136 136 | [] -> [] 137 137 | cmds -> 138 138 let add_cmd acc cmd = 139 139 let syn = synopsis cmd in 140 - (Cmdliner_info.Cmd.docs cmd, `I (syn, cmd_doc cmd)) :: acc 140 + (Cmdliner_info.Cmd_info.docs cmd, `I (syn, cmd_doc cmd)) :: acc 141 141 in 142 142 let by_sec_by_rev_name (s0, `I (c0, _)) (s1, `I (c1, _)) = 143 143 let c = compare s0 s1 in ··· 211 211 if not Cmdliner_info.Arg.(is_pos a && (docv a = "" || doc a = "")) 212 212 then (a :: acc) else acc 213 213 in 214 - let args = Cmdliner_info.Cmd.args @@ Cmdliner_info.Eval.cmd ei in 214 + let args = Cmdliner_info.Cmd_info.args @@ Cmdliner_info.Eval.cmd ei in 215 215 let args = Cmdliner_info.Arg.Set.fold keep_arg args [] in 216 216 let args = List.sort by_sec_by_arg args in 217 217 let args = List.rev_map (arg_to_man_item ~errs ~subst ~buf) args in ··· 233 233 let item = `I (label, Cmdliner_manpage.subst_vars ~errs ~subst buf doc) in 234 234 (Cmdliner_info.Exit.info_docs einfo, item) :: acc 235 235 in 236 - let exits = Cmdliner_info.Cmd.exits @@ Cmdliner_info.Eval.cmd ei in 236 + let exits = Cmdliner_info.Cmd_info.exits @@ Cmdliner_info.Eval.cmd ei in 237 237 let exits = List.sort Cmdliner_info.Exit.info_order exits in 238 238 let exits = List.fold_left add_exit_item [] exits in 239 239 let exits = List.stable_sort by_sec (* sort by section *) exits in ··· 276 276 in 277 277 (* Arg envs before term envs is important here: if the same is mentioned 278 278 both in an arg and in a term the substs of the arg are allowed. *) 279 - let args = Cmdliner_info.Cmd.args @@ Cmdliner_info.Eval.cmd ei in 280 - let tenvs = Cmdliner_info.Cmd.envs @@ Cmdliner_info.Eval.cmd ei in 279 + let args = Cmdliner_info.Cmd_info.args @@ Cmdliner_info.Eval.cmd ei in 280 + let tenvs = Cmdliner_info.Cmd_info.envs @@ Cmdliner_info.Eval.cmd ei in 281 281 let init = Cmdliner_info.Env.Set.empty, [] in 282 282 let acc = Cmdliner_info.Arg.Set.fold add_arg_envs args init in 283 283 let _, envs = List.fold_left add_env acc tenvs in ··· 291 291 let xref_docs ~errs ei = 292 292 let main = Cmdliner_info.Eval.main ei in 293 293 let to_xref = function 294 - | `Main -> Cmdliner_info.Cmd.name main, 1 294 + | `Main -> Cmdliner_info.Cmd_info.name main, 1 295 295 | `Tool tool -> tool, 1 296 296 | `Page (name, sec) -> name, sec 297 297 | `Cmd c -> 298 298 (* N.B. we are handling only the first subcommand level here *) 299 - let cmds = Cmdliner_info.Cmd.children main in 300 - let mname = Cmdliner_info.Cmd.name main in 301 - let is_cmd cmd = Cmdliner_info.Cmd.name cmd = c in 299 + let cmds = Cmdliner_info.Cmd_info.children main in 300 + let mname = Cmdliner_info.Cmd_info.name main in 301 + let is_cmd cmd = Cmdliner_info.Cmd_info.name cmd = c in 302 302 if List.exists is_cmd cmds then strf "%s-%s" mname c, 1 else 303 303 (Format.fprintf errs "xref %s: no such command name@." c; "doc-err", 0) 304 304 in 305 305 let xref_str (name, sec) = strf "%s(%d)" (esc name) sec in 306 - let xrefs = Cmdliner_info.Cmd.man_xrefs @@ Cmdliner_info.Eval.cmd ei in 306 + let xrefs = Cmdliner_info.Cmd_info.man_xrefs @@ Cmdliner_info.Eval.cmd ei in 307 307 let xrefs = match main == Cmdliner_info.Eval.cmd ei with 308 308 | true -> List.filter (fun x -> x <> `Main) xrefs (* filter out default *) 309 309 | false -> xrefs ··· 346 346 sm 347 347 348 348 let text ~errs ei = 349 - let man = Cmdliner_info.Cmd.man @@ Cmdliner_info.Eval.cmd ei in 349 + let man = Cmdliner_info.Cmd_info.man @@ Cmdliner_info.Eval.cmd ei in 350 350 let sm = Cmdliner_manpage.smap_of_blocks man in 351 351 let sm = ensure_s_name ei sm in 352 352 let sm = ensure_s_synopsis ei sm in ··· 355 355 356 356 let title ei = 357 357 let main = Cmdliner_info.Eval.main ei in 358 - let exec = String.capitalize_ascii (Cmdliner_info.Cmd.name main) in 358 + let exec = String.capitalize_ascii (Cmdliner_info.Cmd_info.name main) in 359 359 let cmd = Cmdliner_info.Eval.cmd ei in 360 360 let ancestors = Cmdliner_info.Eval.ancestors ei in 361 361 let name = String.uppercase_ascii (invocation ~sep:"-" ~ancestors cmd) in 362 362 let center_header = esc @@ strf "%s Manual" exec in 363 363 let left_footer = 364 - let version = match Cmdliner_info.Cmd.version main with 364 + let version = match Cmdliner_info.Cmd_info.version main with 365 365 | None -> "" | Some v -> " " ^ v 366 366 in 367 367 esc @@ strf "%s%s" exec version
+14 -12
vendor/opam/cmdliner/src/cmdliner_eval.ml
··· 24 24 let err_argv = "argv array must have at least one element" 25 25 26 26 let add_stdopts ei = 27 - let docs = Cmdliner_info.Cmd.stdopts_docs (Cmdliner_info.Eval.cmd ei) in 27 + let docs = Cmdliner_info.Cmd_info.stdopts_docs (Cmdliner_info.Eval.cmd ei) in 28 28 let vargs, vers = 29 - match Cmdliner_info.Cmd.version (Cmdliner_info.Eval.main ei) with 29 + match Cmdliner_info.Cmd_info.version (Cmdliner_info.Eval.main ei) with 30 30 | None -> Cmdliner_info.Arg.Set.empty, None 31 31 | Some _ -> 32 32 let vers = Cmdliner_arg.stdopt_version ~docs in ··· 34 34 in 35 35 let help = Cmdliner_arg.stdopt_help ~docs in 36 36 let args = Cmdliner_info.Arg.Set.union vargs (Cmdliner_term.argset help) in 37 - let cmd = Cmdliner_info.Cmd.add_args (Cmdliner_info.Eval.cmd ei) args in 37 + let cmd = Cmdliner_info.Cmd_info.add_args (Cmdliner_info.Eval.cmd ei) args in 38 38 help, vers, Cmdliner_info.Eval.with_cmd ei cmd 39 39 40 40 let run_parser ~catch ei cl f = ··· 75 75 (* For now we simply keep backward compat. [cmd] should be 76 76 a name from main's children. *) 77 77 let main = Cmdliner_info.Eval.main ei in 78 - let is_cmd t = Cmdliner_info.Cmd.name t = cmd in 79 - let children = Cmdliner_info.Cmd.children main in 78 + let is_cmd t = Cmdliner_info.Cmd_info.name t = cmd in 79 + let children = Cmdliner_info.Cmd_info.children main in 80 80 let cmd = List.find is_cmd children in 81 81 let _, _, ei = add_stdopts (Cmdliner_info.Eval.with_cmd ei cmd) in 82 82 ei ··· 110 110 let do_deprecated_msgs ~env err_ppf cl ei = 111 111 let cmd_info = Cmdliner_info.Eval.cmd ei in 112 112 let deprecated = Cmdliner_cline.deprecated ~env cl in 113 - match Cmdliner_info.Cmd.deprecated cmd_info, deprecated with 113 + match Cmdliner_info.Cmd_info.deprecated cmd_info, deprecated with 114 114 | None, [] -> () 115 115 | depr_cmd, deprs -> 116 116 let open Cmdliner_base in ··· 119 119 in 120 120 let subst = Cmdliner_info.Eval.doclang_subst ei in 121 121 let pp_cmd_msg ppf cmd = 122 - match Cmdliner_info.Cmd.styled_deprecated ~subst ~errs:err_ppf cmd with 122 + match 123 + Cmdliner_info.Cmd_info.styled_deprecated ~subst ~errs:err_ppf cmd 124 + with 123 125 | "" -> () 124 126 | msg -> 125 - let name = Cmdliner_info.Cmd.name cmd in 127 + let name = Cmdliner_info.Cmd_info.name cmd in 126 128 Fmt.pf ppf "@[%a command %a:@[ %a@]@]" 127 129 Fmt.deprecated () Fmt.code_or_quote name Fmt.styled_text msg 128 130 in ··· 208 210 let ei = Cmdliner_info.Eval.make ~cmd:cmd_info ~ancestors ~env ~err_ppf in 209 211 add_stdopts ei 210 212 in 211 - let cmd_args_info = Cmdliner_info.Cmd.args (Cmdliner_info.Eval.cmd ei) in 213 + let cmd_args_info = Cmdliner_info.Cmd_info.args (Cmdliner_info.Eval.cmd ei) in 212 214 let cline = 213 215 Cmdliner_cline.create ~legacy_prefixes ~for_completion cmd_args_info args 214 216 in ··· 261 263 let version = if version_opt then Some "dummy" else None in 262 264 let cmd_info, parser = 263 265 let args, parser = Cmdliner_term.argset t, Cmdliner_term.parser t in 264 - let cmd_info = Cmdliner_info.Cmd.make ?version "dummy" in 265 - Cmdliner_info.Cmd.add_args cmd_info args, parser 266 + let cmd_info = Cmdliner_info.Cmd_info.make ?version "dummy" in 267 + Cmdliner_info.Cmd_info.add_args cmd_info args, parser 266 268 in 267 269 let help, version, ei = 268 270 let err_ppf = Format.make_formatter (fun _ _ _ -> ()) (fun () -> ()) in ··· 270 272 let ei = Cmdliner_info.Eval.make ~cmd:cmd_info ~ancestors ~env ~err_ppf in 271 273 add_stdopts ei 272 274 in 273 - let cmd_arg_infos = Cmdliner_info.Cmd.args (Cmdliner_info.Eval.cmd ei) in 275 + let cmd_arg_infos = Cmdliner_info.Cmd_info.args (Cmdliner_info.Eval.cmd ei) in 274 276 let cline = 275 277 Cmdliner_cline.create 276 278 ~peek_opts:true ~legacy_prefixes ~for_completion cmd_arg_infos args
+4 -4
vendor/opam/cmdliner/src/cmdliner_info.ml
··· 261 261 262 262 (* Commands *) 263 263 264 - module Cmd = struct 264 + module Cmd_info = struct 265 265 type t = Arg.cmd 266 266 let make 267 267 ?deprecated ?(man_xrefs = [`Main]) ?(man = []) ?(envs = []) ··· 326 326 let main (i : t) = match List.rev i.ancestors with [] -> i.cmd | m :: _ -> m 327 327 let with_cmd (i : t) cmd = { i with cmd } 328 328 329 - let doclang_name n = strf "$(b,%s)" (Cmd.escaped_name n) 329 + let doclang_name n = strf "$(b,%s)" (Cmd_info.escaped_name n) 330 330 let doclang_names names = 331 331 strf "$(b,%s)" (Cmdliner_manpage.escape (String.concat " " names)) 332 332 ··· 336 336 | "cmd.parent" -> 337 337 let ancestors = ancestors i in 338 338 if ancestors = [] then Some (doclang_name (main i)) else 339 - Some (doclang_names (List.rev_map Cmd.name ancestors)) 339 + Some (doclang_names (List.rev_map Cmd_info.name ancestors)) 340 340 | "iname" | "cmd" -> 341 - Some (doclang_names (List.rev_map Cmd.name (cmd i :: ancestors i))) 341 + Some (doclang_names (List.rev_map Cmd_info.name (cmd i :: ancestors i))) 342 342 | _ -> None 343 343 end 344 344
+8 -8
vendor/opam/cmdliner/src/cmdliner_info.mli
··· 138 138 end 139 139 end 140 140 141 - (** Commands. *) 142 - module Cmd : sig 141 + (** Command information. *) 142 + module Cmd_info : sig 143 143 type t 144 144 val make : 145 145 ?deprecated:string -> ?man_xrefs:Cmdliner_manpage.xref list -> ··· 183 183 module Eval : sig 184 184 type t 185 185 val make : 186 - cmd:Cmd.t -> ancestors:Cmd.t list -> env:(string -> string option) -> 187 - err_ppf:Format.formatter -> t 186 + cmd:Cmd_info.t -> ancestors:Cmd_info.t list -> 187 + env:(string -> string option) -> err_ppf:Format.formatter -> t 188 188 189 - val cmd : t -> Cmd.t 190 - val main : t -> Cmd.t 191 - val ancestors : t -> Cmd.t list (* root is last *) 189 + val cmd : t -> Cmd_info.t 190 + val main : t -> Cmd_info.t 191 + val ancestors : t -> Cmd_info.t list (* root is last *) 192 192 val env_var : t -> string -> string option 193 193 val err_ppf : t -> Format.formatter 194 - val with_cmd : t -> Cmd.t -> t 194 + val with_cmd : t -> Cmd_info.t -> t 195 195 val doclang_subst : t -> Cmdliner_manpage.subst 196 196 end 197 197
+2 -2
vendor/opam/cmdliner/src/cmdliner_msg.ml
··· 78 78 (* Other messages *) 79 79 80 80 let pp_version ppf ei = 81 - match Cmdliner_info.Cmd.version (Cmdliner_info.Eval.main ei) with 81 + match Cmdliner_info.Cmd_info.version (Cmdliner_info.Eval.main ei) with 82 82 | None -> assert false 83 83 | Some v -> Fmt.pf ppf "@[%s@]@." v 84 84 85 - let exec_name ei = Cmdliner_info.Cmd.name (Cmdliner_info.Eval.main ei) 85 + let exec_name ei = Cmdliner_info.Cmd_info.name (Cmdliner_info.Eval.main ei) 86 86 87 87 let pp_exec_msg ppf ei = Fmt.pf ppf "%s:" (exec_name ei) 88 88
+5 -3
vendor/opam/cmdliner/src/cmdliner_term.ml
··· 64 64 65 65 let main_name = 66 66 Cmdliner_info.Arg.Set.empty, 67 - (fun ei _ -> Ok (Cmdliner_info.Cmd.name @@ Cmdliner_info.Eval.main ei)) 67 + (fun ei _ -> Ok (Cmdliner_info.Cmd_info.name @@ Cmdliner_info.Eval.main ei)) 68 68 69 69 let choice_names = 70 70 Cmdliner_info.Arg.Set.empty, 71 71 (fun ei _ -> 72 72 (* N.B. this keeps everything backward compatible. We return the command 73 73 names of main's children *) 74 - let name t = Cmdliner_info.Cmd.name t in 75 - let choices = Cmdliner_info.Cmd.children (Cmdliner_info.Eval.main ei) in 74 + let name t = Cmdliner_info.Cmd_info.name t in 75 + let choices = 76 + Cmdliner_info.Cmd_info.children (Cmdliner_info.Eval.main ei) 77 + in 76 78 Ok (List.rev_map name choices)) 77 79 78 80 let with_used_args (al, v) : (_ * string list) t =