···52525353(* Argument converters *)
54545555-module Completion = Cmdliner_info.Arg_completion
5656-module Conv = Cmdliner_info.Arg_conv
5555+module Completion = Cmdliner_def.Arg_completion
5656+module Conv = Cmdliner_def.Arg_conv
5757type 'a conv = 'a Conv.t
5858-let some = Cmdliner_info.Arg_conv.some
5959-let some' = Cmdliner_info.Arg_conv.some'
5858+let some = Cmdliner_def.Arg_conv.some
5959+let some' = Cmdliner_def.Arg_conv.some'
60606161(* Argument information *)
62626363type 'a t = 'a Cmdliner_term.t
6464-type info = Cmdliner_info.Arg_info.t
6565-let info = Cmdliner_info.Arg_info.make
6464+type info = Cmdliner_def.Arg_info.t
6565+let info = Cmdliner_def.Arg_info.make
66666767(* Arguments *)
68686969let no_completion =
7070- Cmdliner_info.Arg_info.Completion Cmdliner_info.Arg_completion.none
7070+ Cmdliner_def.Arg_info.Completion Cmdliner_def.Arg_completion.none
71717272let ( & ) f x = f x
7373let parse_error e = Error (`Parse e)
···8282let parse_to_list parser s = match parser s with
8383| Ok v -> Ok [v] | Error _ as e -> e
84848585-let try_env ei a parse ~absent = match Cmdliner_info.Arg_info.env a with
8585+let try_env ei a parse ~absent = match Cmdliner_def.Arg_info.env a with
8686| None -> Ok absent
8787| Some env ->
8888- let var = Cmdliner_info.Env.info_var env in
8989- match Cmdliner_info.Eval.env_var ei var with
8888+ let var = Cmdliner_def.Env.info_var env in
8989+ match Cmdliner_def.Eval.env_var ei var with
9090 | None -> Ok absent
9191 | Some v ->
9292 match parse v with
9393 | Error e -> parse_error (Cmdliner_msg.err_env_parse env ~err:e)
9494 | Ok _ as v -> v
95959696-let arg_to_args a complete = Cmdliner_info.Arg_info.Set.singleton a complete
9696+let arg_to_args a complete = Cmdliner_def.Arg_info.Set.singleton a complete
9797let list_to_args f l complete =
9898- let add acc v = Cmdliner_info.Arg_info.Set.add (f v) complete acc in
9999- List.fold_left add Cmdliner_info.Arg_info.Set.empty l
9898+ let add acc v = Cmdliner_def.Arg_info.Set.add (f v) complete acc in
9999+ List.fold_left add Cmdliner_def.Arg_info.Set.empty l
100100101101let flag a =
102102- if Cmdliner_info.Arg_info.is_pos a then invalid_arg err_not_opt else
102102+ if Cmdliner_def.Arg_info.is_pos a then invalid_arg err_not_opt else
103103 let convert ei cl = match Cmdliner_cline.opt_arg cl a with
104104 | [] -> try_env ei a env_bool_parse ~absent:false
105105 | [_, _, None] -> Ok true
···110110 Cmdliner_term.make (arg_to_args a no_completion) convert
111111112112let flag_all a =
113113- if Cmdliner_info.Arg_info.is_pos a then invalid_arg err_not_opt else
114114- let a = Cmdliner_info.Arg_info.make_all_opts a in
113113+ if Cmdliner_def.Arg_info.is_pos a then invalid_arg err_not_opt else
114114+ let a = Cmdliner_def.Arg_info.make_all_opts a in
115115 let convert ei cl = match Cmdliner_cline.opt_arg cl a with
116116 | [] -> try_env ei a (parse_to_list env_bool_parse) ~absent:[]
117117 | l ->
···145145 try Ok (aux None l) with Failure e -> parse_error e
146146 in
147147 let flag (_, a) =
148148- if Cmdliner_info.Arg_info.is_pos a then invalid_arg err_not_opt else a
148148+ if Cmdliner_def.Arg_info.is_pos a then invalid_arg err_not_opt else a
149149 in
150150 Cmdliner_term.make (list_to_args flag l no_completion) convert
151151···168168 try Ok (aux [] l) with Failure e -> parse_error e
169169 in
170170 let flag (_, a) =
171171- if Cmdliner_info.Arg_info.is_pos a then invalid_arg err_not_opt else
172172- Cmdliner_info.Arg_info.make_all_opts a
171171+ if Cmdliner_def.Arg_info.is_pos a then invalid_arg err_not_opt else
172172+ Cmdliner_def.Arg_info.make_all_opts a
173173 in
174174 Cmdliner_term.make (list_to_args flag l no_completion) convert
175175···177177| Ok v -> v | Error err -> failwith (Cmdliner_msg.err_opt_parse f ~err)
178178179179let opt ?vopt conv v a =
180180- if Cmdliner_info.Arg_info.is_pos a then invalid_arg err_not_opt else
181181- let absent = match Cmdliner_info.Arg_info.absent a with
182182- | Cmdliner_info.Arg_info.Doc d as a when d <> "" -> a
183183- | _ -> Cmdliner_info.Arg_info.Val (lazy (str_of_pp (Conv.pp conv) v))
180180+ if Cmdliner_def.Arg_info.is_pos a then invalid_arg err_not_opt else
181181+ let absent = match Cmdliner_def.Arg_info.absent a with
182182+ | Cmdliner_def.Arg_info.Doc d as a when d <> "" -> a
183183+ | _ -> Cmdliner_def.Arg_info.Val (lazy (str_of_pp (Conv.pp conv) v))
184184 in
185185 let kind = match vopt with
186186- | None -> Cmdliner_info.Arg_info.Opt
187187- | Some dv -> Cmdliner_info.Arg_info.Opt_vopt (str_of_pp (Conv.pp conv) dv)
186186+ | None -> Cmdliner_def.Arg_info.Opt
187187+ | Some dv -> Cmdliner_def.Arg_info.Opt_vopt (str_of_pp (Conv.pp conv) dv)
188188 in
189189- let docv = match Cmdliner_info.Arg_info.docv a with
189189+ let docv = match Cmdliner_def.Arg_info.docv a with
190190 | "" -> Conv.docv conv | docv -> docv
191191 in
192192- let a = Cmdliner_info.Arg_info.make_opt ~docv ~absent ~kind a in
192192+ let a = Cmdliner_def.Arg_info.make_opt ~docv ~absent ~kind a in
193193 let convert ei cl = match Cmdliner_cline.opt_arg cl a with
194194 | [] -> try_env ei a (Conv.parser conv) ~absent:v
195195 | [_, f, Some v] ->
···206206 Cmdliner_term.make (arg_to_args a (Completion (Conv.completion conv))) convert
207207208208let opt_all ?vopt conv v a =
209209- if Cmdliner_info.Arg_info.is_pos a then invalid_arg err_not_opt else
210210- let absent = match Cmdliner_info.Arg_info.absent a with
211211- | Cmdliner_info.Arg_info.Doc d as a when d <> "" -> a
212212- | _ -> Cmdliner_info.Arg_info.Val (lazy "")
209209+ if Cmdliner_def.Arg_info.is_pos a then invalid_arg err_not_opt else
210210+ let absent = match Cmdliner_def.Arg_info.absent a with
211211+ | Cmdliner_def.Arg_info.Doc d as a when d <> "" -> a
212212+ | _ -> Cmdliner_def.Arg_info.Val (lazy "")
213213 in
214214 let kind = match vopt with
215215- | None -> Cmdliner_info.Arg_info.Opt
216216- | Some dv -> Cmdliner_info.Arg_info.Opt_vopt (str_of_pp (Conv.pp conv) dv)
215215+ | None -> Cmdliner_def.Arg_info.Opt
216216+ | Some dv -> Cmdliner_def.Arg_info.Opt_vopt (str_of_pp (Conv.pp conv) dv)
217217 in
218218- let docv = match Cmdliner_info.Arg_info.docv a with
218218+ let docv = match Cmdliner_def.Arg_info.docv a with
219219 | "" -> Conv.docv conv | docv -> docv
220220 in
221221- let a = Cmdliner_info.Arg_info.make_opt_all ~docv ~absent ~kind a in
221221+ let a = Cmdliner_def.Arg_info.make_opt_all ~docv ~absent ~kind a in
222222 let convert ei cl = match Cmdliner_cline.opt_arg cl a with
223223 | [] -> try_env ei a (parse_to_list (Conv.parser conv)) ~absent:v
224224 | l ->
···241241| Error err -> failwith (Cmdliner_msg.err_pos_parse a ~err)
242242243243let pos ?(rev = false) k conv v a =
244244- if Cmdliner_info.Arg_info.is_opt a then invalid_arg err_not_pos else
245245- let absent = match Cmdliner_info.Arg_info.absent a with
246246- | Cmdliner_info.Arg_info.Doc d as a when d <> "" -> a
247247- | _ -> Cmdliner_info.Arg_info.Val (lazy (str_of_pp (Conv.pp conv) v))
244244+ if Cmdliner_def.Arg_info.is_opt a then invalid_arg err_not_pos else
245245+ let absent = match Cmdliner_def.Arg_info.absent a with
246246+ | Cmdliner_def.Arg_info.Doc d as a when d <> "" -> a
247247+ | _ -> Cmdliner_def.Arg_info.Val (lazy (str_of_pp (Conv.pp conv) v))
248248 in
249249- let pos = Cmdliner_info.Arg_info.pos ~rev ~start:k ~len:(Some 1) in
250250- let docv = match Cmdliner_info.Arg_info.docv a with
249249+ let pos = Cmdliner_def.Arg_info.pos ~rev ~start:k ~len:(Some 1) in
250250+ let docv = match Cmdliner_def.Arg_info.docv a with
251251 | "" -> Conv.docv conv | docv -> docv
252252 in
253253- let a = Cmdliner_info.Arg_info.make_pos_abs ~docv ~absent ~pos a in
253253+ let a = Cmdliner_def.Arg_info.make_pos_abs ~docv ~absent ~pos a in
254254 let convert ei cl = match Cmdliner_cline.pos_arg cl a with
255255 | [] -> try_env ei a (Conv.parser conv) ~absent:v
256256 | [v] ->
···261261 Cmdliner_term.make (arg_to_args a (Completion (Conv.completion conv))) convert
262262263263let pos_list pos conv v a =
264264- if Cmdliner_info.Arg_info.is_opt a then invalid_arg err_not_pos else
265265- let docv = match Cmdliner_info.Arg_info.docv a with
264264+ if Cmdliner_def.Arg_info.is_opt a then invalid_arg err_not_pos else
265265+ let docv = match Cmdliner_def.Arg_info.docv a with
266266 | "" -> Conv.docv conv | docv -> docv
267267 in
268268- let a = Cmdliner_info.Arg_info.make_pos ~docv ~pos a in
268268+ let a = Cmdliner_def.Arg_info.make_pos ~docv ~pos a in
269269 let convert ei cl = match Cmdliner_cline.pos_arg cl a with
270270 | [] -> try_env ei a (parse_to_list (Conv.parser conv)) ~absent:v
271271 | l ->
···275275 in
276276 Cmdliner_term.make (arg_to_args a (Completion (Conv.completion conv))) convert
277277278278-let all = Cmdliner_info.Arg_info.pos ~rev:false ~start:0 ~len:None
278278+let all = Cmdliner_def.Arg_info.pos ~rev:false ~start:0 ~len:None
279279let pos_all c v a = pos_list all c v a
280280281281let pos_left ?(rev = false) k =
282282 let start = if rev then k + 1 else 0 in
283283 let len = if rev then None else Some k in
284284- pos_list (Cmdliner_info.Arg_info.pos ~rev ~start ~len)
284284+ pos_list (Cmdliner_def.Arg_info.pos ~rev ~start ~len)
285285286286let pos_right ?(rev = false) k =
287287 let start = if rev then 0 else k + 1 in
288288 let len = if rev then Some k else None in
289289- pos_list (Cmdliner_info.Arg_info.pos ~rev ~start ~len)
289289+ pos_list (Cmdliner_def.Arg_info.pos ~rev ~start ~len)
290290291291(* Arguments as terms *)
292292293293let absent_error args =
294294 let make_req a v acc =
295295- let req_a = Cmdliner_info.Arg_info.make_req a in
296296- Cmdliner_info.Arg_info.Set.add req_a v acc
295295+ let req_a = Cmdliner_def.Arg_info.make_req a in
296296+ Cmdliner_def.Arg_info.Set.add req_a v acc
297297 in
298298- Cmdliner_info.Arg_info.Set.fold make_req args Cmdliner_info.Arg_info.Set.empty
298298+ Cmdliner_def.Arg_info.Set.fold make_req args Cmdliner_def.Arg_info.Set.empty
299299300300let value a = a
301301302302let err_arg_missing args =
303303 parse_error @@
304304- Cmdliner_msg.err_arg_missing (fst (Cmdliner_info.Arg_info.Set.choose args))
304304+ Cmdliner_msg.err_arg_missing (fst (Cmdliner_def.Arg_info.Set.choose args))
305305306306let required t =
307307 let args = absent_error (Cmdliner_term.argset t) in
+2-2
vendor/opam/cmdliner/src/cmdliner_arg.mli
···5353type info
5454val info :
5555 ?deprecated:string -> ?absent:string -> ?docs:string ->
5656- ?doc_envs:Cmdliner_info.Env.info list -> ?docv:string -> ?doc:string ->
5757- ?env:Cmdliner_info.Env.info -> string list -> info
5656+ ?doc_envs:Cmdliner_def.Env.info list -> ?docv:string -> ?doc:string ->
5757+ ?env:Cmdliner_def.Env.info -> string list -> info
58585959val ( & ) : ('a -> 'b) -> 'a -> 'b
6060
+37-37
vendor/opam/cmdliner/src/cmdliner_cline.ml
···2828 if not for_completion || not (has_complete_prefix s) then None else
2929 Some (get_token_to_complete s)
30303131-exception Completion_requested of Cmdliner_info.Complete.t
3131+exception Completion_requested of Cmdliner_def.Complete.t
32323333let comp_request ?after_dashdash ~prefix kind =
3434- let comp = Cmdliner_info.Complete.make ?after_dashdash ~prefix kind in
3434+ let comp = Cmdliner_def.Complete.make ?after_dashdash ~prefix kind in
3535 raise (Completion_requested comp)
36363737(* Command lines *)
38383939let err_multi_opt_name_def name a a' =
4040 let kind = "option name" in
4141- Cmdliner_base.err_multi_def ~kind name Cmdliner_info.Arg_info.doc a a'
4141+ Cmdliner_base.err_multi_def ~kind name Cmdliner_def.Arg_info.doc a a'
42424343-type arg = Cmdliner_info.Cline.arg
4444-type t = Cmdliner_info.Cline.t
4343+type arg = Cmdliner_def.Cline.arg
4444+type t = Cmdliner_def.Cline.t
45454646let get_arg cline a : arg =
4747- try Cmdliner_info.Arg_info.Map.find a cline with Not_found -> assert false
4747+ try Cmdliner_def.Arg_info.Map.find a cline with Not_found -> assert false
48484949let opt_arg cline a = match get_arg cline a with O l -> l | _ -> assert false
5050let pos_arg cline a = match get_arg cline a with P l -> l | _ -> assert false
···6363 let rec loop optidx posidx cline = function
6464 | [] -> optidx, posidx, cline
6565 | a :: l ->
6666- match Cmdliner_info.Arg_info.is_pos a with
6666+ match Cmdliner_def.Arg_info.is_pos a with
6767 | true ->
6868- let cline = Cmdliner_info.Arg_info.Map.add a (P [] : arg) cline in
6868+ let cline = Cmdliner_def.Arg_info.Map.add a (P [] : arg) cline in
6969 loop optidx (a :: posidx) cline l
7070 | false ->
7171 let add t name = match Cmdliner_trie.add t name a with
7272 | `New t -> t
7373 | `Replaced (a', _) -> invalid_arg (err_multi_opt_name_def name a a')
7474 in
7575- let names = Cmdliner_info.Arg_info.opt_names a in
7575+ let names = Cmdliner_def.Arg_info.opt_names a in
7676 let optidx = List.fold_left add optidx names in
7777- let cline = Cmdliner_info.Arg_info.Map.add a (O [] : arg) cline in
7777+ let cline = Cmdliner_def.Arg_info.Map.add a (O [] : arg) cline in
7878 loop optidx posidx cline l
7979 in
8080- let cline = Cmdliner_info.Arg_info.Map.empty in
8181- loop Cmdliner_trie.empty [] cline (Cmdliner_info.Arg_info.Set.elements args)
8080+ let cline = Cmdliner_def.Arg_info.Map.empty in
8181+ loop Cmdliner_trie.empty [] cline (Cmdliner_def.Arg_info.Set.elements args)
82828383(* Optional argument parsing *)
8484···126126127127let parse_opt_value ~for_completion arg_info name value args =
128128 (* Either we got a value glued in [value] or we need to get one in args *)
129129- match Cmdliner_info.Arg_info.opt_kind arg_info with
129129+ match Cmdliner_def.Arg_info.opt_kind arg_info with
130130 | Flag -> (* Flags have no values but we may get dash sharing in [value] *)
131131 begin match value with
132132 | None -> value, args
···151151let try_complete_opt_value arg_info name value args =
152152 (* At that point we found a matching option name so this should be mostly
153153 about completing a glued option value, but there are twists. *)
154154- match Cmdliner_info.Arg_info.opt_kind arg_info with
155155- | Cmdliner_info.Arg_info.Flag ->
154154+ match Cmdliner_def.Arg_info.opt_kind arg_info with
155155+ | Cmdliner_def.Arg_info.Flag ->
156156 begin match value with
157157 | Some v when is_short_opt name ->
158158 (* short flag dash sharing, push the completion *)
···205205 else parse_opt_value ~for_completion arg_info name value args
206206 in
207207 let arg : arg = O ((k, name, value) :: opt_arg cline arg_info) in
208208- let cline = Cmdliner_info.Arg_info.Map.add arg_info arg cline in
208208+ let cline = Cmdliner_def.Arg_info.Map.add arg_info arg cline in
209209 loop errs (k + 1) cline pargs args
210210 | Error `Not_found when for_completion ->
211211 if not is_completion
···246246 in the list index posidx, is given a value according the list
247247 of positional arguments values [pargs]. *)
248248 if pargs = [] then
249249- let misses = List.filter Cmdliner_info.Arg_info.is_req posidx in
249249+ let misses = List.filter Cmdliner_def.Arg_info.is_req posidx in
250250 if misses = [] then Ok cline else
251251 Error (Cmdliner_msg.err_pos_misses misses, cline)
252252 else
···255255 let rec loop misses cline max_spec = function
256256 | [] -> misses, cline, max_spec
257257 | a :: al ->
258258- let apos = Cmdliner_info.Arg_info.pos_kind a in
259259- let rev = Cmdliner_info.Arg_info.pos_rev apos in
260260- let start = pos rev (Cmdliner_info.Arg_info.pos_start apos) in
261261- let stop = match Cmdliner_info.Arg_info.pos_len apos with
258258+ let apos = Cmdliner_def.Arg_info.pos_kind a in
259259+ let rev = Cmdliner_def.Arg_info.pos_rev apos in
260260+ let start = pos rev (Cmdliner_def.Arg_info.pos_start apos) in
261261+ let stop = match Cmdliner_def.Arg_info.pos_len apos with
262262 | None -> pos rev last
263263- | Some n -> pos rev (Cmdliner_info.Arg_info.pos_start apos + n - 1)
263263+ | Some n -> pos rev (Cmdliner_def.Arg_info.pos_start apos + n - 1)
264264 in
265265 let start, stop = if rev then stop, start else start, stop in
266266 let args =
267267 match take_range ~for_completion start stop pargs with
268268 | `Range args -> args
269269 | `Complete prefix ->
270270- let kind = Cmdliner_info.Complete.Opt_name_or_pos_value a in
270270+ let kind = Cmdliner_def.Complete.Opt_name_or_pos_value a in
271271 comp_request ~after_dashdash:has_dashdash ~prefix kind
272272 in
273273 let max_spec = max stop max_spec in
274274- let cline = Cmdliner_info.Arg_info.Map.add a (P args : arg) cline in
275275- let misses = match Cmdliner_info.Arg_info.is_req a && args = [] with
274274+ let cline = Cmdliner_def.Arg_info.Map.add a (P args : arg) cline in
275275+ let misses = match Cmdliner_def.Arg_info.is_req a && args = [] with
276276 | true -> a :: misses
277277 | false -> misses
278278 in
···328328329329(* Deprecations *)
330330331331-type deprecated = Cmdliner_info.Arg_info.t * arg
331331+type deprecated = Cmdliner_def.Arg_info.t * arg
332332333333let deprecated ~env cline =
334334 let add ~env info arg acc =
335335 let deprecation_invoked = match (arg : arg) with
336336 | O [] | P [] -> (* nothing on the cli for the argument *)
337337- begin match Cmdliner_info.Arg_info.env info with
337337+ begin match Cmdliner_def.Arg_info.env info with
338338 | None -> false
339339 | Some ienv ->
340340 (* the parse uses the env var if defined which may be deprecated *)
341341- Option.is_some (Cmdliner_info.Env.info_deprecated ienv) &&
342342- Option.is_some (env (Cmdliner_info.Env.info_var ienv))
341341+ Option.is_some (Cmdliner_def.Env.info_deprecated ienv) &&
342342+ Option.is_some (env (Cmdliner_def.Env.info_var ienv))
343343 end
344344- | _ -> Option.is_some (Cmdliner_info.Arg_info.deprecated info)
344344+ | _ -> Option.is_some (Cmdliner_def.Arg_info.deprecated info)
345345 in
346346 if deprecation_invoked then (info, arg) :: acc else acc
347347 in
348348- List.rev (Cmdliner_info.Arg_info.Map.fold (add ~env) cline [])
348348+ List.rev (Cmdliner_def.Arg_info.Map.fold (add ~env) cline [])
349349350350let pp_deprecated ~subst ppf (info, arg) =
351351 let open Cmdliner_base in
352352 let plural l = if List.length l > 1 then "s" else "" in
353353- let subst = Cmdliner_info.Arg_info.doclang_subst ~subst info in
353353+ let subst = Cmdliner_def.Arg_info.doclang_subst ~subst info in
354354 match (arg : arg) with
355355 | O [] | P [] ->
356356- let env = Option.get (Cmdliner_info.Arg_info.env info) in
357357- let msg = Cmdliner_info.Env.styled_deprecated ~errs:ppf ~subst env in
356356+ let env = Option.get (Cmdliner_def.Arg_info.env info) in
357357+ let msg = Cmdliner_def.Env.styled_deprecated ~errs:ppf ~subst env in
358358 Fmt.pf ppf "@[%a @[environment variable %a: %a@]@]"
359359- Fmt.deprecated () Fmt.code (Cmdliner_info.Env.info_var env)
359359+ Fmt.deprecated () Fmt.code (Cmdliner_def.Env.info_var env)
360360 Fmt.styled_text msg
361361 | O os ->
362362 let plural = plural os in
363363 let names = List.map (fun (_, n, _) -> n) os in
364364- let msg = Cmdliner_info.Arg_info.styled_deprecated ~errs:ppf ~subst info in
364364+ let msg = Cmdliner_def.Arg_info.styled_deprecated ~errs:ppf ~subst info in
365365 Fmt.pf ppf "@[%a @[option%s %a: %a@]@]"
366366 Fmt.deprecated () plural Fmt.(list ~sep:sp code_or_quote) names
367367 Fmt.styled_text msg
368368 | P args ->
369369 let plural = plural args in
370370 let msg =
371371- Cmdliner_info.Arg_info.styled_deprecated ~errs:ppf ~subst info
371371+ Cmdliner_def.Arg_info.styled_deprecated ~errs:ppf ~subst info
372372 in
373373 Fmt.pf ppf "@[%a @[argument%s %a: %a@]@]"
374374 Fmt.deprecated () plural Fmt.(list ~sep:sp code_or_quote) args
+6-6
vendor/opam/cmdliner/src/cmdliner_cline.mli
···11111212(** {1:cli Command lines} *)
13131414-type t = Cmdliner_info.Cline.t
1414+type t = Cmdliner_def.Cline.t
15151616val create :
1717 ?peek_opts:bool -> legacy_prefixes:bool -> for_completion:bool ->
1818- Cmdliner_info.Arg_info.Set.t -> string list ->
1818+ Cmdliner_def.Arg_info.Set.t -> string list ->
1919 [ `Ok of t
2020- | `Complete of Cmdliner_info.Complete.t
2020+ | `Complete of Cmdliner_def.Complete.t
2121 | `Error of string * t ]
22222323val opt_arg :
2424- t -> Cmdliner_info.Arg_info.t -> (int * string * (string option)) list
2424+ t -> Cmdliner_def.Arg_info.t -> (int * string * (string option)) list
25252626-val pos_arg : t -> Cmdliner_info.Arg_info.t -> string list
2727-val actual_args : t -> Cmdliner_info.Arg_info.t -> string list
2626+val pos_arg : t -> Cmdliner_def.Arg_info.t -> string list
2727+val actual_args : t -> Cmdliner_def.Arg_info.t -> string list
2828(** Actual command line arguments from the command line *)
29293030(** {1:deprecations Deprecations} *)
+8-8
vendor/opam/cmdliner/src/cmdliner_cmd.ml
···5566(* Commands *)
7788-type info = Cmdliner_info.Cmd_info.t
99-let info = Cmdliner_info.Cmd_info.make
88+type info = Cmdliner_def.Cmd_info.t
99+let info = Cmdliner_def.Cmd_info.make
10101111type 'a t =
1212| Cmd of info * 'a Cmdliner_term.parser
1313| Group of info * ('a Cmdliner_term.parser option * 'a t list)
14141515let make info t =
1616- let info = Cmdliner_info.Cmd_info.add_args info (Cmdliner_term.argset t) in
1616+ let info = Cmdliner_def.Cmd_info.add_args info (Cmdliner_term.argset t) in
1717 Cmd (info, Cmdliner_term.parser t)
18181919let v = make
···2828 | Some t -> Some (Cmdliner_term.argset t), Some (Cmdliner_term.parser t)
2929 in
3030 let children = List.map get_info cmds in
3131- let info = Cmdliner_info.Cmd_info.with_children info ~args ~children in
3131+ let info = Cmdliner_def.Cmd_info.with_children info ~args ~children in
3232 Group (info, (parser, cmds))
33333434-let name c = Cmdliner_info.Cmd_info.name (get_info c)
3434+let name c = Cmdliner_def.Cmd_info.name (get_info c)
35353636let name_trie cmds =
3737 let add acc cmd =
3838 let info = get_info cmd in
3939- let name = Cmdliner_info.Cmd_info.name info in
3939+ let name = Cmdliner_def.Cmd_info.name info in
4040 match Cmdliner_trie.add acc name cmd with
4141 | `New t -> t
4242 | `Replaced (cmd', _) ->
4343 let info' = get_info cmd' and kind = "command" in
4444 invalid_arg @@
4545 Cmdliner_base.err_multi_def ~kind name
4646- Cmdliner_info.Cmd_info.doc info info'
4646+ Cmdliner_def.Cmd_info.doc info info'
4747 in
4848 List.fold_left add Cmdliner_trie.empty cmds
49495050let list_names cmds =
5151- let cmd_name c = Cmdliner_info.Cmd_info.name (get_info c) in
5151+ let cmd_name c = Cmdliner_def.Cmd_info.name (get_info c) in
5252 List.sort String.compare (List.rev_map cmd_name cmds)
+3-3
vendor/opam/cmdliner/src/cmdliner_cmd.mli
···5566(** Commands and their information. *)
7788-type info = Cmdliner_info.Cmd_info.t
88+type info = Cmdliner_def.Cmd_info.t
991010val info :
1111 ?deprecated:string -> ?man_xrefs:Cmdliner_manpage.xref list ->
1212- ?man:Cmdliner_manpage.block list -> ?envs:Cmdliner_info.Env.info list ->
1313- ?exits:Cmdliner_info.Exit.info list -> ?sdocs:string -> ?docs:string ->
1212+ ?man:Cmdliner_manpage.block list -> ?envs:Cmdliner_def.Env.info list ->
1313+ ?exits:Cmdliner_def.Exit.info list -> ?sdocs:string -> ?docs:string ->
1414 ?doc:string -> ?version:string -> string -> info
15151616type 'a t =
+19-19
vendor/opam/cmdliner/src/cmdliner_completion.ml
···19192020let pp_opt ~err_ppf ~subst ~prefix ppf arg_info _ =
2121 (* XXX should we rather list a single name ? *)
2222- let names = Cmdliner_info.Arg_info.opt_names arg_info in
2323- let subst = Cmdliner_info.Arg_info.doclang_subst ~subst arg_info in
2424- let doc = Cmdliner_info.Arg_info.styled_doc ~errs:err_ppf ~subst arg_info in
2222+ let names = Cmdliner_def.Arg_info.opt_names arg_info in
2323+ let subst = Cmdliner_def.Arg_info.doclang_subst ~subst arg_info in
2424+ let doc = Cmdliner_def.Arg_info.styled_doc ~errs:err_ppf ~subst arg_info in
2525 List.iter (fun name -> pp_item ppf ~prefix (name, doc)) names
26262727let pp_opt_names ~err_ppf ~subst ~prefix ppf cmd =
2828 let info = Cmdliner_cmd.get_info cmd in
2929- let set = Cmdliner_info.Cmd_info.args info in
3030- if not (Cmdliner_info.Arg_info.Set.is_empty set) then begin
3131- let arg_infos = Cmdliner_info.Cmd_info.args info in
2929+ let set = Cmdliner_def.Cmd_info.args info in
3030+ if not (Cmdliner_def.Arg_info.Set.is_empty set) then begin
3131+ let arg_infos = Cmdliner_def.Cmd_info.args info in
3232 pp_group ppf "Options";
3333- Cmdliner_info.Arg_info.Set.iter (pp_opt ~err_ppf ~subst ~prefix ppf) arg_infos
3333+ Cmdliner_def.Arg_info.Set.iter (pp_opt ~err_ppf ~subst ~prefix ppf) arg_infos
3434 end
35353636let pp_arg_values ~after_dashdash ~prefix ppf comp =
3737- if after_dashdash && Cmdliner_info.Arg_completion.restart comp
3737+ if after_dashdash && Cmdliner_def.Arg_completion.restart comp
3838 then pp_line ppf "restart" else
3939- let items = Cmdliner_info.Arg_completion.complete comp prefix in
4040- let comp_files = Cmdliner_info.Arg_completion.files comp in
4141- let comp_dirs = Cmdliner_info.Arg_completion.dirs comp in
3939+ let items = Cmdliner_def.Arg_completion.complete comp prefix in
4040+ let comp_files = Cmdliner_def.Arg_completion.files comp in
4141+ let comp_dirs = Cmdliner_def.Arg_completion.dirs comp in
4242 if items <> [] || comp_files || comp_dirs then begin
4343 pp_group ppf "Values";
4444 List.iter (pp_item ppf ~prefix) items;
···4949let pp_subcmds ~err_ppf ~subst ~prefix ppf cmd =
5050 pp_group ppf "Subcommands";
5151 let complete_cmd cmd =
5252- let name = Cmdliner_info.Cmd_info.name cmd in
5252+ let name = Cmdliner_def.Cmd_info.name cmd in
5353 (* FIXME subst is wrong here. *)
5454- let doc = Cmdliner_info.Cmd_info.styled_doc ~errs:err_ppf ~subst cmd in
5454+ let doc = Cmdliner_def.Cmd_info.styled_doc ~errs:err_ppf ~subst cmd in
5555 pp_item ppf ~prefix (name, doc)
5656 in
5757 List.iter complete_cmd (Cmdliner_cmd.get_children_infos cmd)
···5959let vnum = 1 (* Protocol version number *)
60606161let output ~out_ppf ~err_ppf ei cmd_args_info cmd comp =
6262- let subst = Cmdliner_info.Eval.doclang_subst ei in
6363- let after_dashdash = Cmdliner_info.Complete.after_dashdash comp in
6464- let prefix = Cmdliner_info.Complete.prefix comp in
6262+ let subst = Cmdliner_def.Eval.doclang_subst ei in
6363+ let after_dashdash = Cmdliner_def.Complete.after_dashdash comp in
6464+ let prefix = Cmdliner_def.Complete.prefix comp in
6565 let pp_arg_value ppf arg_info =
6666- begin match Cmdliner_info.Arg_info.Set.find_opt arg_info cmd_args_info with
6666+ begin match Cmdliner_def.Arg_info.Set.find_opt arg_info cmd_args_info with
6767 | None -> ()
6868 | Some (Completion comp) -> pp_arg_values ~after_dashdash ~prefix ppf comp
6969 end;
7070 in
7171 let pp ppf () =
7272- begin match Cmdliner_info.Complete.kind comp with
7272+ begin match Cmdliner_def.Complete.kind comp with
7373 | Opt_value arg_info -> pp_arg_value ppf arg_info
7474 | Opt_name_or_pos_value arg_info ->
7575 pp_arg_value ppf arg_info;
···7979 if not after_dashdash
8080 then pp_opt_names ~err_ppf ~subst ~prefix ppf cmd;
8181 end;
8282- if Cmdliner_info.Complete.subcmds comp
8282+ if Cmdliner_def.Complete.subcmds comp
8383 then pp_subcmds ~err_ppf ~subst ~prefix ppf cmd
8484 in
8585 Cmdliner_base.Fmt.pf out_ppf "@[<v>%d@,%a@]@?" vnum pp ()
+3-3
vendor/opam/cmdliner/src/cmdliner_completion.mli
···66val output :
77 out_ppf:Format.formatter ->
88 err_ppf:Format.formatter ->
99- Cmdliner_info.Eval.t ->
1010- Cmdliner_info.Arg_info.Set.t ->
1111- 'a Cmdliner_cmd.t -> Cmdliner_info.Complete.t -> unit
99+ Cmdliner_def.Eval.t ->
1010+ Cmdliner_def.Arg_info.Set.t ->
1111+ 'a Cmdliner_cmd.t -> Cmdliner_def.Complete.t -> unit
+96-96
vendor/opam/cmdliner/src/cmdliner_docgen.ml
···77let strf = Printf.sprintf
8899let order_args a0 a1 =
1010- match Cmdliner_info.Arg_info.is_opt a0, Cmdliner_info.Arg_info.is_opt a1 with
1010+ match Cmdliner_def.Arg_info.is_opt a0, Cmdliner_def.Arg_info.is_opt a1 with
1111 | true, true -> (* optional by name *)
1212 let key names =
1313 let k = List.hd (List.sort rev_compare names) in
···1515 if k.[1] = '-' then String.sub k 1 (String.length k - 1) else k
1616 in
1717 compare
1818- (key @@ Cmdliner_info.Arg_info.opt_names a0)
1919- (key @@ Cmdliner_info.Arg_info.opt_names a1)
1818+ (key @@ Cmdliner_def.Arg_info.opt_names a0)
1919+ (key @@ Cmdliner_def.Arg_info.opt_names a1)
2020 | false, false -> (* positional by variable *)
2121 compare
2222- (String.lowercase_ascii @@ Cmdliner_info.Arg_info.docv a0)
2323- (String.lowercase_ascii @@ Cmdliner_info.Arg_info.docv a1)
2222+ (String.lowercase_ascii @@ Cmdliner_def.Arg_info.docv a0)
2323+ (String.lowercase_ascii @@ Cmdliner_def.Arg_info.docv a1)
2424 | true, false -> -1 (* positional first *)
2525 | false, true -> 1 (* optional after *)
2626···4747(* Command docs *)
48484949let invocation ?(sep = " ") ?(ancestors = []) cmd =
5050- let names = List.rev_map Cmdliner_info.Cmd_info.name (cmd :: ancestors) in
5050+ let names = List.rev_map Cmdliner_def.Cmd_info.name (cmd :: ancestors) in
5151 esc @@ String.concat sep names
52525353let synopsis_pos_arg a =
5454- let v = match Cmdliner_info.Arg_info.docv a with "" -> "ARG" | v -> v in
5454+ let v = match Cmdliner_def.Arg_info.docv a with "" -> "ARG" | v -> v in
5555 let v = strf "$(i,%s)" (esc v) in
5656 let v =
5757- (if Cmdliner_info.Arg_info.is_req a then strf "%s" else strf "[%s]") v
5757+ (if Cmdliner_def.Arg_info.is_req a then strf "%s" else strf "[%s]") v
5858 in
5959- match Cmdliner_info.Arg_info.(pos_len @@ pos_kind a) with
5959+ match Cmdliner_def.Arg_info.(pos_len @@ pos_kind a) with
6060 | None -> v ^ "…"
6161 | Some 1 -> v
6262 | Some n ->
···6464 String.concat " " (loop n [])
65656666let synopsis_opt_arg a n =
6767- let var = match Cmdliner_info.Arg_info.docv a with "" -> "VAL" | v -> v in
6868- match Cmdliner_info.Arg_info.opt_kind a with
6969- | Cmdliner_info.Arg_info.Flag -> strf "$(b,%s)" (esc n)
7070- | Cmdliner_info.Arg_info.Opt ->
6767+ let var = match Cmdliner_def.Arg_info.docv a with "" -> "VAL" | v -> v in
6868+ match Cmdliner_def.Arg_info.opt_kind a with
6969+ | Cmdliner_def.Arg_info.Flag -> strf "$(b,%s)" (esc n)
7070+ | Cmdliner_def.Arg_info.Opt ->
7171 if String.length n > 2
7272 then strf "$(b,%s)=$(i,%s)" (esc n) (esc var)
7373 else strf "$(b,%s) $(i,%s)" (esc n) (esc var)
7474- | Cmdliner_info.Arg_info.Opt_vopt _ ->
7474+ | Cmdliner_def.Arg_info.Opt_vopt _ ->
7575 if String.length n > 2
7676 then strf "$(b,%s)[=$(i,%s)]" (esc n) (esc var)
7777 else strf "$(b,%s) [$(i,%s)]" (esc n) (esc var)
78787979-let deprecated cmd = match Cmdliner_info.Cmd_info.deprecated cmd with
7979+let deprecated cmd = match Cmdliner_def.Cmd_info.deprecated cmd with
8080| None -> "" | Some _ -> "(Deprecated) "
81818282let synopsis ?(show_help = false) ?ancestors cmd =
8383 let show_help = if show_help then " [$(b,--help)]" else "" in
8484- match Cmdliner_info.Cmd_info.children cmd with
8484+ match Cmdliner_def.Cmd_info.children cmd with
8585 | [] ->
8686 let rev_cli_order (a0, _) (a1, _) =
8787- Cmdliner_info.Arg_info.rev_pos_cli_order a0 a1
8787+ Cmdliner_def.Arg_info.rev_pos_cli_order a0 a1
8888 in
8989- let args = Cmdliner_info.Cmd_info.args cmd in
8989+ let args = Cmdliner_def.Cmd_info.args cmd in
9090 let oargs, pargs =
9191- Cmdliner_info.Arg_info.(Set.partition (fun a _ -> is_opt a) args)
9191+ Cmdliner_def.Arg_info.(Set.partition (fun a _ -> is_opt a) args)
9292 in
9393 let oargs =
9494 (* Keep only those that are listed in the s_options section and
9595 that are not [--version] or [--help]. * *)
9696 let keep a _ =
9797 let drop_names n = n = "--help" || n = "--version" in
9898- Cmdliner_info.Arg_info.docs a = Cmdliner_manpage.s_options &&
9999- not (List.exists drop_names (Cmdliner_info.Arg_info.opt_names a))
9898+ Cmdliner_def.Arg_info.docs a = Cmdliner_manpage.s_options &&
9999+ not (List.exists drop_names (Cmdliner_def.Arg_info.opt_names a))
100100 in
101101- let oargs = Cmdliner_info.Arg_info.Set.(elements (filter keep oargs)) in
101101+ let oargs = Cmdliner_def.Arg_info.Set.(elements (filter keep oargs)) in
102102 let count = List.length oargs in
103103 let any_option = "[$(i,OPTION)]…" in
104104 if count = 0 || count > 3 then any_option else
105105 let syn a =
106106 let syn =
107107- synopsis_opt_arg a (Cmdliner_info.Arg_info.opt_name_sample a)
107107+ synopsis_opt_arg a (Cmdliner_def.Arg_info.opt_name_sample a)
108108 in
109109- if Cmdliner_info.Arg_info.is_req a
109109+ if Cmdliner_def.Arg_info.is_req a
110110 then syn
111111 else strf "[%s]" syn
112112 in
···115115 String.concat " " [oargs; any_option]
116116 in
117117 let pargs =
118118- let pargs = Cmdliner_info.Arg_info.Set.elements pargs in
118118+ let pargs = Cmdliner_def.Arg_info.Set.elements pargs in
119119 if pargs = [] then "" else
120120 let pargs = List.map (fun a -> a, synopsis_pos_arg a) pargs in
121121 let pargs = List.sort rev_cli_order pargs in
···124124 strf "%s$(b,%s)%s %s%s"
125125 (deprecated cmd) (invocation ?ancestors cmd) show_help oargs pargs
126126 | _cmds ->
127127- let subcmd = match Cmdliner_info.Cmd_info.has_args cmd with
127127+ let subcmd = match Cmdliner_def.Cmd_info.has_args cmd with
128128 | false -> "$(i,COMMAND)" | true -> "[$(i,COMMAND)]"
129129 in
130130 strf "%s$(b,%s)%s %s …" (deprecated cmd) (invocation ?ancestors cmd)
131131 show_help subcmd
132132133133let cmd_doc cmd =
134134- let depr = match Cmdliner_info.Cmd_info.deprecated cmd with
134134+ let depr = match Cmdliner_def.Cmd_info.deprecated cmd with
135135 | None -> "" | Some msg -> msg ^ " "
136136 in
137137- depr ^ Cmdliner_info.Cmd_info.doc cmd
137137+ depr ^ Cmdliner_def.Cmd_info.doc cmd
138138139139-let cmd_docs ei = match Cmdliner_info.(Cmd_info.children (Eval.cmd ei)) with
139139+let cmd_docs ei = match Cmdliner_def.(Cmd_info.children (Eval.cmd ei)) with
140140| [] -> []
141141| cmds ->
142142 let add_cmd acc cmd =
143143 let syn = synopsis cmd in
144144- (Cmdliner_info.Cmd_info.docs cmd, `I (syn, cmd_doc cmd)) :: acc
144144+ (Cmdliner_def.Cmd_info.docs cmd, `I (syn, cmd_doc cmd)) :: acc
145145 in
146146 let by_sec_by_rev_name (s0, `I (c0, _)) (s1, `I (c1, _)) =
147147 let c = compare s0 s1 in
···155155(* Argument docs *)
156156157157let arg_man_item_label a =
158158- let s = match Cmdliner_info.Arg_info.is_pos a with
159159- | true -> strf "$(i,%s)" (esc @@ Cmdliner_info.Arg_info.docv a)
158158+ let s = match Cmdliner_def.Arg_info.is_pos a with
159159+ | true -> strf "$(i,%s)" (esc @@ Cmdliner_def.Arg_info.docv a)
160160 | false ->
161161- let names = List.sort compare (Cmdliner_info.Arg_info.opt_names a) in
161161+ let names = List.sort compare (Cmdliner_def.Arg_info.opt_names a) in
162162 String.concat ", " (List.rev_map (synopsis_opt_arg a) names)
163163 in
164164- match Cmdliner_info.Arg_info.deprecated a with
164164+ match Cmdliner_def.Arg_info.deprecated a with
165165 | None -> s | Some _ -> "(Deprecated) " ^ s
166166167167let arg_to_man_item ~errs ~subst ~buf a =
168168- let subst = Cmdliner_info.Arg_info.doclang_subst ~subst a in
169169- let or_env ~value a = match Cmdliner_info.Arg_info.env a with
168168+ let subst = Cmdliner_def.Arg_info.doclang_subst ~subst a in
169169+ let or_env ~value a = match Cmdliner_def.Arg_info.env a with
170170 | None -> ""
171171 | Some e ->
172172 let value = if value then " or" else "absent " in
173173- strf "%s $(b,%s) env" value (esc @@ Cmdliner_info.Env.info_var e)
173173+ strf "%s $(b,%s) env" value (esc @@ Cmdliner_def.Env.info_var e)
174174 in
175175- let absent = match Cmdliner_info.Arg_info.absent a with
176176- | Cmdliner_info.Arg_info.Err -> "required"
177177- | Cmdliner_info.Arg_info.Doc "" -> strf "%s" (or_env ~value:false a)
178178- | Cmdliner_info.Arg_info.Doc s ->
175175+ let absent = match Cmdliner_def.Arg_info.absent a with
176176+ | Cmdliner_def.Arg_info.Err -> "required"
177177+ | Cmdliner_def.Arg_info.Doc "" -> strf "%s" (or_env ~value:false a)
178178+ | Cmdliner_def.Arg_info.Doc s ->
179179 let s = Cmdliner_manpage.subst_vars ~errs ~subst buf s in
180180 strf "absent=%s%s" s (or_env ~value:true a)
181181- | Cmdliner_info.Arg_info.Val v ->
181181+ | Cmdliner_def.Arg_info.Val v ->
182182 match Lazy.force v with
183183 | "" -> strf "%s" (or_env ~value:false a)
184184 | v -> strf "absent=$(b,%s)%s" (esc v) (or_env ~value:true a)
185185 in
186186- let optvopt = match Cmdliner_info.Arg_info.opt_kind a with
187187- | Cmdliner_info.Arg_info.Opt_vopt v -> strf "default=$(b,%s)" (esc v)
186186+ let optvopt = match Cmdliner_def.Arg_info.opt_kind a with
187187+ | Cmdliner_def.Arg_info.Opt_vopt v -> strf "default=$(b,%s)" (esc v)
188188 | _ -> ""
189189 in
190190 let argvdoc = match optvopt, absent with
···192192 | s, "" | "", s -> strf " (%s)" s
193193 | s, s' -> strf " (%s) (%s)" s s'
194194 in
195195- let deprecated = match Cmdliner_info.Arg_info.deprecated a with
195195+ let deprecated = match Cmdliner_def.Arg_info.deprecated a with
196196 | None -> "" | Some msg -> msg ^ " "
197197 in
198198- let doc = deprecated ^ Cmdliner_info.Arg_info.doc a in
198198+ let doc = deprecated ^ Cmdliner_def.Arg_info.doc a in
199199 let doc = Cmdliner_manpage.subst_vars ~errs ~subst buf doc in
200200- (Cmdliner_info.Arg_info.docs a, `I (arg_man_item_label a ^ argvdoc, doc))
200200+ (Cmdliner_def.Arg_info.docs a, `I (arg_man_item_label a ^ argvdoc, doc))
201201202202let arg_docs ~errs ~subst ~buf ei =
203203 let by_sec_by_arg a0 a1 =
204204 let c = compare
205205- (Cmdliner_info.Arg_info.docs a0)
206206- (Cmdliner_info.Arg_info.docs a1)
205205+ (Cmdliner_def.Arg_info.docs a0)
206206+ (Cmdliner_def.Arg_info.docs a1)
207207 in
208208 if c <> 0 then c else
209209 let c =
210210 match
211211- Cmdliner_info.Arg_info.deprecated a0,
212212- Cmdliner_info.Arg_info.deprecated a1
211211+ Cmdliner_def.Arg_info.deprecated a0,
212212+ Cmdliner_def.Arg_info.deprecated a1
213213 with
214214 | None, None | Some _, Some _ -> 0
215215 | None, Some _ -> -1 | Some _, None -> 1
···217217 if c <> 0 then c else order_args a0 a1
218218 in
219219 let keep_arg a _ acc =
220220- if not Cmdliner_info.Arg_info.(is_pos a && (docv a = "" || doc a = ""))
220220+ if not Cmdliner_def.Arg_info.(is_pos a && (docv a = "" || doc a = ""))
221221 then (a :: acc) else acc
222222 in
223223- let args = Cmdliner_info.Cmd_info.args @@ Cmdliner_info.Eval.cmd ei in
224224- let args = Cmdliner_info.Arg_info.Set.fold keep_arg args [] in
223223+ let args = Cmdliner_def.Cmd_info.args @@ Cmdliner_def.Eval.cmd ei in
224224+ let args = Cmdliner_def.Arg_info.Set.fold keep_arg args [] in
225225 let args = List.sort by_sec_by_arg args in
226226 let args = List.rev_map (arg_to_man_item ~errs ~subst ~buf) args in
227227 sorted_items_to_blocks ~boilerplate:None args
···235235let exit_docs ~errs ~subst ~buf ~has_sexit ei =
236236 let by_sec (s0, _) (s1, _) = compare s0 s1 in
237237 let add_exit_item acc einfo =
238238- let subst = Cmdliner_info.Exit.doclang_subst ~subst einfo in
239239- let min, max = Cmdliner_info.Exit.info_codes einfo in
240240- let doc = Cmdliner_info.Exit.info_doc einfo in
238238+ let subst = Cmdliner_def.Exit.doclang_subst ~subst einfo in
239239+ let min, max = Cmdliner_def.Exit.info_codes einfo in
240240+ let doc = Cmdliner_def.Exit.info_doc einfo in
241241 let label = if min = max then strf "%d" min else strf "%d-%d" min max in
242242 let item = `I (label, Cmdliner_manpage.subst_vars ~errs ~subst buf doc) in
243243- (Cmdliner_info.Exit.info_docs einfo, item) :: acc
243243+ (Cmdliner_def.Exit.info_docs einfo, item) :: acc
244244 in
245245- let exits = Cmdliner_info.Cmd_info.exits @@ Cmdliner_info.Eval.cmd ei in
246246- let exits = List.sort Cmdliner_info.Exit.info_order exits in
245245+ let exits = Cmdliner_def.Cmd_info.exits @@ Cmdliner_def.Eval.cmd ei in
246246+ let exits = List.sort Cmdliner_def.Exit.info_order exits in
247247 let exits = List.fold_left add_exit_item [] exits in
248248 let exits = List.stable_sort by_sec (* sort by section *) exits in
249249 let boilerplate = if has_sexit then None else Some exit_boilerplate in
···257257258258let env_docs ~errs ~subst ~buf ~has_senv ei =
259259 let add_env_item ~subst (seen, envs as acc) e =
260260- if Cmdliner_info.Env.Set.mem e seen then acc else
261261- let seen = Cmdliner_info.Env.Set.add e seen in
262262- let var = strf "$(b,%s)" @@ esc (Cmdliner_info.Env.info_var e) in
263263- let var, deprecated = match Cmdliner_info.Env.info_deprecated e with
260260+ if Cmdliner_def.Env.Set.mem e seen then acc else
261261+ let seen = Cmdliner_def.Env.Set.add e seen in
262262+ let var = strf "$(b,%s)" @@ esc (Cmdliner_def.Env.info_var e) in
263263+ let var, deprecated = match Cmdliner_def.Env.info_deprecated e with
264264 | None -> var, "" | Some msg -> "(Deprecated) " ^ var, msg ^ " " in
265265- let doc = deprecated ^ Cmdliner_info.Env.info_doc e in
265265+ let doc = deprecated ^ Cmdliner_def.Env.info_doc e in
266266 let doc = Cmdliner_manpage.subst_vars ~errs ~subst buf doc in
267267- let envs = (Cmdliner_info.Env.info_docs e, `I (var, doc)) :: envs in
267267+ let envs = (Cmdliner_def.Env.info_docs e, `I (var, doc)) :: envs in
268268 seen, envs
269269 in
270270 let add_arg_envs a _ acc =
271271- let envs = Cmdliner_info.Arg_info.doc_envs a in
272272- let envs = match Cmdliner_info.Arg_info.env a with
271271+ let envs = Cmdliner_def.Arg_info.doc_envs a in
272272+ let envs = match Cmdliner_def.Arg_info.env a with
273273 | None -> envs | Some e -> e :: envs
274274 in
275275- let subst = Cmdliner_info.Arg_info.doclang_subst ~subst a in
275275+ let subst = Cmdliner_def.Arg_info.doclang_subst ~subst a in
276276 List.fold_left (add_env_item ~subst) acc envs
277277 in
278278 let add_env acc e =
279279- let subst = Cmdliner_info.Env.doclang_subst ~subst e in
279279+ let subst = Cmdliner_def.Env.doclang_subst ~subst e in
280280 add_env_item ~subst acc e
281281 in
282282 let by_sec_by_rev_name (s0, `I (v0, _)) (s1, `I (v1, _)) =
···285285 in
286286 (* Arg envs before term envs is important here: if the same is mentioned
287287 both in an arg and in a term the substs of the arg are allowed. *)
288288- let args = Cmdliner_info.Cmd_info.args @@ Cmdliner_info.Eval.cmd ei in
289289- let tenvs = Cmdliner_info.Cmd_info.envs @@ Cmdliner_info.Eval.cmd ei in
290290- let init = Cmdliner_info.Env.Set.empty, [] in
291291- let acc = Cmdliner_info.Arg_info.Set.fold add_arg_envs args init in
288288+ let args = Cmdliner_def.Cmd_info.args @@ Cmdliner_def.Eval.cmd ei in
289289+ let tenvs = Cmdliner_def.Cmd_info.envs @@ Cmdliner_def.Eval.cmd ei in
290290+ let init = Cmdliner_def.Env.Set.empty, [] in
291291+ let acc = Cmdliner_def.Arg_info.Set.fold add_arg_envs args init in
292292 let _, envs = List.fold_left add_env acc tenvs in
293293 let envs = List.sort by_sec_by_rev_name envs in
294294 let envs = (envs :> (string * Cmdliner_manpage.block) list) in
···298298(* xref doc *)
299299300300let xref_docs ~errs ei =
301301- let main = Cmdliner_info.Eval.main ei in
301301+ let main = Cmdliner_def.Eval.main ei in
302302 let to_xref = function
303303- | `Main -> Cmdliner_info.Cmd_info.name main, 1
303303+ | `Main -> Cmdliner_def.Cmd_info.name main, 1
304304 | `Tool tool -> tool, 1
305305 | `Page (name, sec) -> name, sec
306306 | `Cmd c ->
307307 (* N.B. we are handling only the first subcommand level here *)
308308- let cmds = Cmdliner_info.Cmd_info.children main in
309309- let mname = Cmdliner_info.Cmd_info.name main in
310310- let is_cmd cmd = Cmdliner_info.Cmd_info.name cmd = c in
308308+ let cmds = Cmdliner_def.Cmd_info.children main in
309309+ let mname = Cmdliner_def.Cmd_info.name main in
310310+ let is_cmd cmd = Cmdliner_def.Cmd_info.name cmd = c in
311311 if List.exists is_cmd cmds then strf "%s-%s" mname c, 1 else
312312 (Format.fprintf errs "xref %s: no such command name@." c; "doc-err", 0)
313313 in
314314 let xref_str (name, sec) = strf "%s(%d)" (esc name) sec in
315315- let xrefs = Cmdliner_info.Cmd_info.man_xrefs @@ Cmdliner_info.Eval.cmd ei in
316316- let xrefs = match main == Cmdliner_info.Eval.cmd ei with
315315+ let xrefs = Cmdliner_def.Cmd_info.man_xrefs @@ Cmdliner_def.Eval.cmd ei in
316316+ let xrefs = match main == Cmdliner_def.Eval.cmd ei with
317317 | true -> List.filter (fun x -> x <> `Main) xrefs (* filter out default *)
318318 | false -> xrefs
319319 in
···326326327327let ensure_s_name ei sm =
328328 if Cmdliner_manpage.(smap_has_section sm ~sec:s_name) then sm else
329329- let cmd = Cmdliner_info.Eval.cmd ei in
330330- let ancestors = Cmdliner_info.Eval.ancestors ei in
329329+ let cmd = Cmdliner_def.Eval.cmd ei in
330330+ let ancestors = Cmdliner_def.Eval.ancestors ei in
331331 let tname = (deprecated cmd) ^ invocation ~sep:"-" ~ancestors cmd in
332332 let tdoc = cmd_doc cmd in
333333 let tagline = if tdoc = "" then "" else strf " - %s" tdoc in
···336336337337let ensure_s_synopsis ei sm =
338338 if Cmdliner_manpage.(smap_has_section sm ~sec:s_synopsis) then sm else
339339- let cmd = Cmdliner_info.Eval.cmd ei in
340340- let ancestors = Cmdliner_info.Eval.ancestors ei in
339339+ let cmd = Cmdliner_def.Eval.cmd ei in
340340+ let ancestors = Cmdliner_def.Eval.ancestors ei in
341341 let synopsis = `P (synopsis ~ancestors cmd) in
342342 Cmdliner_manpage.(smap_append_block sm ~sec:s_synopsis synopsis)
343343344344let insert_cmd_man_docs ~errs ei sm =
345345 let buf = Buffer.create 200 in
346346- let subst = Cmdliner_info.Eval.doclang_subst ei in
346346+ let subst = Cmdliner_def.Eval.doclang_subst ei in
347347 let ins sm (sec, b) = Cmdliner_manpage.smap_append_block sm ~sec b in
348348 let has_senv = Cmdliner_manpage.(smap_has_section sm ~sec:s_environment) in
349349 let has_sexit = Cmdliner_manpage.(smap_has_section sm ~sec:s_exit_status) in
···355355 sm
356356357357let text ~errs ei =
358358- let man = Cmdliner_info.Cmd_info.man @@ Cmdliner_info.Eval.cmd ei in
358358+ let man = Cmdliner_def.Cmd_info.man @@ Cmdliner_def.Eval.cmd ei in
359359 let sm = Cmdliner_manpage.smap_of_blocks man in
360360 let sm = ensure_s_name ei sm in
361361 let sm = ensure_s_synopsis ei sm in
···363363 Cmdliner_manpage.smap_to_blocks sm
364364365365let title ei =
366366- let main = Cmdliner_info.Eval.main ei in
367367- let exec = String.capitalize_ascii (Cmdliner_info.Cmd_info.name main) in
368368- let cmd = Cmdliner_info.Eval.cmd ei in
369369- let ancestors = Cmdliner_info.Eval.ancestors ei in
366366+ let main = Cmdliner_def.Eval.main ei in
367367+ let exec = String.capitalize_ascii (Cmdliner_def.Cmd_info.name main) in
368368+ let cmd = Cmdliner_def.Eval.cmd ei in
369369+ let ancestors = Cmdliner_def.Eval.ancestors ei in
370370 let name = String.uppercase_ascii (invocation ~sep:"-" ~ancestors cmd) in
371371 let center_header = esc @@ strf "%s Manual" exec in
372372 let left_footer =
373373- let version = match Cmdliner_info.Cmd_info.version main with
373373+ let version = match Cmdliner_def.Cmd_info.version main with
374374 | None -> "" | Some v -> " " ^ v
375375 in
376376 esc @@ strf "%s%s" exec version
···380380let man ~errs ei = title ei, text ~errs ei
381381382382let pp_man ~env ~errs fmt ppf ei =
383383- let subst = Cmdliner_info.Eval.doclang_subst ei in
383383+ let subst = Cmdliner_def.Eval.doclang_subst ei in
384384 Cmdliner_manpage.print ~env ~errs ~subst fmt ppf (man ~errs ei)
385385386386(* Plain synopsis for usage *)
387387388388let styled_usage_synopsis ~errs ei =
389389- let subst = Cmdliner_info.Eval.doclang_subst ei in
390390- let cmd = Cmdliner_info.Eval.cmd ei in
391391- let ancestors = Cmdliner_info.Eval.ancestors ei in
389389+ let subst = Cmdliner_def.Eval.doclang_subst ei in
390390+ let cmd = Cmdliner_def.Eval.cmd ei in
391391+ let ancestors = Cmdliner_def.Eval.ancestors ei in
392392 let synopsis = synopsis ~show_help:true ~ancestors cmd in
393393 Cmdliner_manpage.doc_to_styled ~errs ~subst synopsis
···5566type 'a eval_ok = [ `Ok of 'a | `Version | `Help ]
77type eval_error = [ `Parse | `Term | `Exn ]
88-type 'a eval_exit = [ `Ok of 'a | `Exit of Cmdliner_info.Exit.code ]
88+type 'a eval_exit = [ `Ok of 'a | `Exit of Cmdliner_def.Exit.code ]
991010type 'a complete =
1111- Cmdliner_info.Arg_info.Set.t * 'a Cmdliner_cmd.t * Cmdliner_info.Complete.t
1111+ Cmdliner_def.Arg_info.Set.t * 'a Cmdliner_cmd.t * Cmdliner_def.Complete.t
12121313type eval_result_error =
1414 [ Cmdliner_term.term_escape
···2424let err_argv = "argv array must have at least one element"
25252626let add_stdopts ei =
2727- let docs = Cmdliner_info.Cmd_info.stdopts_docs (Cmdliner_info.Eval.cmd ei) in
2727+ let docs = Cmdliner_def.Cmd_info.stdopts_docs (Cmdliner_def.Eval.cmd ei) in
2828 let vargs, vers =
2929- match Cmdliner_info.Cmd_info.version (Cmdliner_info.Eval.main ei) with
3030- | None -> Cmdliner_info.Arg_info.Set.empty, None
2929+ match Cmdliner_def.Cmd_info.version (Cmdliner_def.Eval.main ei) with
3030+ | None -> Cmdliner_def.Arg_info.Set.empty, None
3131 | Some _ ->
3232 let vers = Cmdliner_arg.stdopt_version ~docs in
3333 (Cmdliner_term.argset vers), Some vers
3434 in
3535 let help = Cmdliner_arg.stdopt_help ~docs in
3636 let args =
3737- Cmdliner_info.Arg_info.Set.union vargs (Cmdliner_term.argset help)
3737+ Cmdliner_def.Arg_info.Set.union vargs (Cmdliner_term.argset help)
3838 in
3939- let cmd = Cmdliner_info.Cmd_info.add_args (Cmdliner_info.Eval.cmd ei) args in
4040- help, vers, Cmdliner_info.Eval.with_cmd ei cmd
3939+ let cmd = Cmdliner_def.Cmd_info.add_args (Cmdliner_def.Eval.cmd ei) args in
4040+ help, vers, Cmdliner_def.Eval.with_cmd ei cmd
41414242let run_parser ~catch ei cl f =
4343 try (f ei cl :> ('a, eval_result_error) result) with
···6666 let ei = match cmd_name with
6767 | None (* help of main command requested *) ->
6868 let env _ = assert false in
6969- let cmd = Cmdliner_info.Eval.main ei in
7070- let ei' = Cmdliner_info.Eval.make ~cmd ~ancestors:[] ~env ~err_ppf in
7171- begin match Cmdliner_info.Eval.ancestors ei with
6969+ let cmd = Cmdliner_def.Eval.main ei in
7070+ let ei' = Cmdliner_def.Eval.make ~cmd ~ancestors:[] ~env ~err_ppf in
7171+ begin match Cmdliner_def.Eval.ancestors ei with
7272 | [] -> (* [ei] is an evaluation of main, [cmd] has stdopts *) ei'
7373 | _ -> let _, _, ei = add_stdopts ei' in ei
7474 end
···7676 try
7777 (* For now we simply keep backward compat. [cmd] should be
7878 a name from main's children. *)
7979- let main = Cmdliner_info.Eval.main ei in
8080- let is_cmd t = Cmdliner_info.Cmd_info.name t = cmd in
8181- let children = Cmdliner_info.Cmd_info.children main in
7979+ let main = Cmdliner_def.Eval.main ei in
8080+ let is_cmd t = Cmdliner_def.Cmd_info.name t = cmd in
8181+ let children = Cmdliner_def.Cmd_info.children main in
8282 let cmd = List.find is_cmd children in
8383- let _, _, ei = add_stdopts (Cmdliner_info.Eval.with_cmd ei cmd) in
8383+ let _, _, ei = add_stdopts (Cmdliner_def.Eval.with_cmd ei cmd) in
8484 ei
8585 with Not_found -> invalid_arg (err_help cmd)
8686 in
···110110 Error `Term
111111112112let do_deprecated_msgs ~env err_ppf cl ei =
113113- let cmd_info = Cmdliner_info.Eval.cmd ei in
113113+ let cmd_info = Cmdliner_def.Eval.cmd ei in
114114 let deprecated = Cmdliner_cline.deprecated ~env cl in
115115- match Cmdliner_info.Cmd_info.deprecated cmd_info, deprecated with
115115+ match Cmdliner_def.Cmd_info.deprecated cmd_info, deprecated with
116116 | None, [] -> ()
117117 | depr_cmd, deprs ->
118118 let open Cmdliner_base in
119119 let pp_sep ppf () =
120120 if Option.is_some depr_cmd && deprs <> [] then Fmt.cut ppf ();
121121 in
122122- let subst = Cmdliner_info.Eval.doclang_subst ei in
122122+ let subst = Cmdliner_def.Eval.doclang_subst ei in
123123 let pp_cmd_msg ppf cmd =
124124 match
125125- Cmdliner_info.Cmd_info.styled_deprecated ~subst ~errs:err_ppf cmd
125125+ Cmdliner_def.Cmd_info.styled_deprecated ~subst ~errs:err_ppf cmd
126126 with
127127 | "" -> ()
128128 | msg ->
129129- let name = Cmdliner_info.Cmd_info.name cmd in
129129+ let name = Cmdliner_def.Cmd_info.name cmd in
130130 Fmt.pf ppf "@[%a command %a:@[ %a@]@]"
131131 Fmt.deprecated () Fmt.code_or_quote name Fmt.styled_text msg
132132 in
···209209 in
210210 let help, version, ei =
211211 let cmd_info = Cmdliner_cmd.get_info cmd in
212212- let ei = Cmdliner_info.Eval.make ~cmd:cmd_info ~ancestors ~env ~err_ppf in
212212+ let ei = Cmdliner_def.Eval.make ~cmd:cmd_info ~ancestors ~env ~err_ppf in
213213 add_stdopts ei
214214 in
215215- let cmd_args_info = Cmdliner_info.Cmd_info.args (Cmdliner_info.Eval.cmd ei) in
215215+ let cmd_args_info = Cmdliner_def.Cmd_info.args (Cmdliner_def.Eval.cmd ei) in
216216 let cline =
217217 Cmdliner_cline.create ~legacy_prefixes ~for_completion cmd_args_info args
218218 in
···234234 | Error `Complete ->
235235 begin match cline with
236236 | `Complete comp ->
237237- let comp = Cmdliner_info.Complete.add_subcmds comp in
237237+ let comp = Cmdliner_def.Complete.add_subcmds comp in
238238 Error (`Complete (cmd_args_info, cmd, comp))
239239 | `Ok _ | `Error _ -> assert false
240240 end
···265265 let version = if version_opt then Some "dummy" else None in
266266 let cmd_info, parser =
267267 let args, parser = Cmdliner_term.argset t, Cmdliner_term.parser t in
268268- let cmd_info = Cmdliner_info.Cmd_info.make ?version "dummy" in
269269- Cmdliner_info.Cmd_info.add_args cmd_info args, parser
268268+ let cmd_info = Cmdliner_def.Cmd_info.make ?version "dummy" in
269269+ Cmdliner_def.Cmd_info.add_args cmd_info args, parser
270270 in
271271 let help, version, ei =
272272 let err_ppf = Format.make_formatter (fun _ _ _ -> ()) (fun () -> ()) in
273273 let ancestors = [] in
274274- let ei = Cmdliner_info.Eval.make ~cmd:cmd_info ~ancestors ~env ~err_ppf in
274274+ let ei = Cmdliner_def.Eval.make ~cmd:cmd_info ~ancestors ~env ~err_ppf in
275275 add_stdopts ei
276276 in
277277- let cmd_arg_infos = Cmdliner_info.Cmd_info.args (Cmdliner_info.Eval.cmd ei) in
277277+ let cmd_arg_infos = Cmdliner_def.Cmd_info.args (Cmdliner_def.Eval.cmd ei) in
278278 let cline =
279279 Cmdliner_cline.create
280280 ~peek_opts:true ~legacy_prefixes ~for_completion cmd_arg_infos args
···308308 in
309309 (v, ret)
310310311311-let exit_status_of_result ?(term_err = Cmdliner_info.Exit.cli_error) = function
312312-| Ok (`Ok _ | `Help | `Version) -> Cmdliner_info.Exit.ok
311311+let exit_status_of_result ?(term_err = Cmdliner_def.Exit.cli_error) = function
312312+| Ok (`Ok _ | `Help | `Version) -> Cmdliner_def.Exit.ok
313313| Error `Term -> term_err
314314-| Error `Parse -> Cmdliner_info.Exit.cli_error
315315-| Error `Exn -> Cmdliner_info.Exit.internal_error
314314+| Error `Parse -> Cmdliner_def.Exit.cli_error
315315+| Error `Exn -> Cmdliner_def.Exit.internal_error
316316317317let eval_value' ?help ?err ?catch ?env ?argv ?term_err cmd =
318318 match eval_value ?help ?err ?catch ?env ?argv cmd with
···337337 ?help ?(err = Format.err_formatter) ?catch ?env ?argv ?term_err cmd
338338 =
339339 match eval_value ?help ~err ?catch ?env ?argv cmd with
340340- | Ok (`Ok (Error msg)) -> pp_err err cmd ~msg; Cmdliner_info.Exit.some_error
340340+ | Ok (`Ok (Error msg)) -> pp_err err cmd ~msg; Cmdliner_def.Exit.some_error
341341 | r -> exit_status_of_result ?term_err r
342342343343let eval_result'
···345345 =
346346 match eval_value ?help ~err ?catch ?env ?argv cmd with
347347 | Ok (`Ok (Ok c)) -> c
348348- | Ok (`Ok (Error msg)) -> pp_err err cmd ~msg; Cmdliner_info.Exit.some_error
348348+ | Ok (`Ok (Error msg)) -> pp_err err cmd ~msg; Cmdliner_def.Exit.some_error
349349 | r -> exit_status_of_result ?term_err r
···88(* Environment variable errors *)
991010let err_env_parse env ~err =
1111- let var = Cmdliner_info.Env.info_var env in
1111+ let var = Cmdliner_def.Env.info_var env in
1212 Fmt.str "@[environment variable %a: %s@]" Fmt.code_or_quote var err
13131414(* Positional argument errors *)
···1818 Fmt.ereason "too many arguments"
1919 Fmt.(list ~sep:comma code_or_quote) excess
20202121-let err_pos_miss a = match Cmdliner_info.Arg_info.docv a with
2121+let err_pos_miss a = match Cmdliner_def.Arg_info.docv a with
2222| "" -> Fmt.str "@[a required argument is %a@]" Fmt.missing ()
2323| v -> Fmt.str "@[required argument %a is %a@]" Fmt.code_var v Fmt.missing ()
2424···2626| [] -> assert false
2727| [a] -> err_pos_miss a
2828| args ->
2929- let add_arg acc a = match Cmdliner_info.Arg_info.docv a with
2929+ let add_arg acc a = match Cmdliner_def.Arg_info.docv a with
3030 | "" -> "ARG" :: acc
3131 | argv -> argv :: acc
3232 in
3333- let rev_args = List.sort Cmdliner_info.Arg_info.rev_pos_cli_order args in
3333+ let rev_args = List.sort Cmdliner_def.Arg_info.rev_pos_cli_order args in
3434 let args = List.fold_left add_arg [] rev_args in
3535 Fmt.str "@[required arguments %a@ are@ %a@]"
3636 Fmt.(list ~sep:comma code_var) args Fmt.missing ()
37373838-let err_pos_parse a ~err = match Cmdliner_info.Arg_info.docv a with
3838+let err_pos_parse a ~err = match Cmdliner_def.Arg_info.docv a with
3939| "" -> err
4040| argv ->
4141- match Cmdliner_info.Arg_info.(pos_len @@ pos_kind a) with
4141+ match Cmdliner_def.Arg_info.(pos_len @@ pos_kind a) with
4242 | Some 1 -> Fmt.str "@[%a argument: %s@]" Fmt.code_var argv err
4343 | None | Some _ -> Fmt.str "@[%a… arguments: %s@]" Fmt.code_var argv err
4444···6767(* Argument errors *)
68686969let err_arg_missing a =
7070- if Cmdliner_info.Arg_info.is_pos a then err_pos_miss a else
7070+ if Cmdliner_def.Arg_info.is_pos a then err_pos_miss a else
7171 Fmt.str "@[required option %a is %a@]"
7272- Fmt.code (Cmdliner_info.Arg_info.opt_name_sample a) Fmt.missing ()
7272+ Fmt.code (Cmdliner_def.Arg_info.opt_name_sample a) Fmt.missing ()
73737474let err_cmd_missing ~dom =
7575 Fmt.str "@[required %a name is %a,@ must@ be@ %a@]"
···7878(* Other messages *)
79798080let pp_version ppf ei =
8181- match Cmdliner_info.Cmd_info.version (Cmdliner_info.Eval.main ei) with
8181+ match Cmdliner_def.Cmd_info.version (Cmdliner_def.Eval.main ei) with
8282 | None -> assert false
8383 | Some v -> Fmt.pf ppf "@[%s@]@." v
84848585-let exec_name ei = Cmdliner_info.Cmd_info.name (Cmdliner_info.Eval.main ei)
8585+let exec_name ei = Cmdliner_def.Cmd_info.name (Cmdliner_def.Eval.main ei)
86868787let pp_exec_msg ppf ei = Fmt.pf ppf "%s:" (exec_name ei)
8888
···33 SPDX-License-Identifier: ISC
44 ---------------------------------------------------------------------------*)
5566-type term_escape = Cmdliner_info.Term.escape
77-type 'a parser = 'a Cmdliner_info.Term.parser
88-type +'a t = 'a Cmdliner_info.Term.t
66+type term_escape = Cmdliner_def.Term.escape
77+type 'a parser = 'a Cmdliner_def.Term.parser
88+type +'a t = 'a Cmdliner_def.Term.t
991010let make args p = (args, p)
1111let argset (args, _) = args
1212let parser (_, parser) = parser
13131414-let const v = Cmdliner_info.Arg_info.Set.empty, (fun _ _ -> Ok v)
1414+let const v = Cmdliner_def.Arg_info.Set.empty, (fun _ _ -> Ok v)
1515let app (args_f, f) (args_v, v) =
1616- Cmdliner_info.Arg_info.Set.union args_f args_v,
1616+ Cmdliner_def.Arg_info.Set.union args_f args_v,
1717 fun ei cl -> match (f ei cl) with
1818 | Error _ as e -> e
1919 | Ok f ->
···6363 cli_parse_result wrap
64646565let main_name =
6666- Cmdliner_info.Arg_info.Set.empty,
6767- (fun ei _ -> Ok (Cmdliner_info.Cmd_info.name @@ Cmdliner_info.Eval.main ei))
6666+ Cmdliner_def.Arg_info.Set.empty,
6767+ (fun ei _ -> Ok (Cmdliner_def.Cmd_info.name @@ Cmdliner_def.Eval.main ei))
68686969let choice_names =
7070- Cmdliner_info.Arg_info.Set.empty,
7070+ Cmdliner_def.Arg_info.Set.empty,
7171 (fun ei _ ->
7272 (* N.B. this keeps everything backward compatible. We return the command
7373 names of main's children *)
7474- let name t = Cmdliner_info.Cmd_info.name t in
7474+ let name t = Cmdliner_def.Cmd_info.name t in
7575 let choices =
7676- Cmdliner_info.Cmd_info.children (Cmdliner_info.Eval.main ei)
7676+ Cmdliner_def.Cmd_info.children (Cmdliner_def.Eval.main ei)
7777 in
7878 Ok (List.rev_map name choices))
7979···8686 List.rev_append args acc
8787 in
8888 let used =
8989- List.rev (Cmdliner_info.Arg_info.Set.fold actual_args al [])
8989+ List.rev (Cmdliner_def.Arg_info.Set.fold actual_args al [])
9090 in
9191 Ok (x, used)
9292 | Error _ as e -> e
939394949595let env =
9696- Cmdliner_info.Arg_info.Set.empty,
9797- (fun ei _ -> Ok (Cmdliner_info.Eval.env_var ei))
9696+ Cmdliner_def.Arg_info.Set.empty,
9797+ (fun ei _ -> Ok (Cmdliner_def.Eval.env_var ei))
+4-4
vendor/opam/cmdliner/src/cmdliner_term.mli
···1010 | `Help of Cmdliner_manpage.format * string option ]
11111212type 'a parser =
1313- Cmdliner_info.Eval.t -> Cmdliner_cline.t ->
1313+ Cmdliner_def.Eval.t -> Cmdliner_cline.t ->
1414 ('a, [ `Parse of string | term_escape ]) result
1515(** Type type for command line parser. given static information about
1616 the command line and a command line to parse returns an OCaml value. *)
17171818-type +'a t = 'a Cmdliner_info.Term.t
1818+type +'a t = 'a Cmdliner_def.Term.t
1919(** The type for terms. The list of arguments it can parse and the parsing
2020 function that does so. *)
21212222-val make : Cmdliner_info.Arg_info.Set.t -> 'a parser -> 'a t
2323-val argset : 'a t -> Cmdliner_info.Arg_info.Set.t
2222+val make : Cmdliner_def.Arg_info.Set.t -> 'a parser -> 'a t
2323+val argset : 'a t -> Cmdliner_def.Arg_info.Set.t
2424val parser : 'a t -> 'a parser
25252626val const : 'a -> 'a t