From 923d061d7253c90d653bad1d886acbce0501385a Mon Sep 17 00:00:00 2001 From: Benjamin Canou Date: Mon, 5 Dec 2016 13:18:12 +0100 Subject: [PATCH] Client: help generation fixes. --- src/client/client_aliases.ml | 8 ++++---- src/utils/cli_entries.ml | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/client/client_aliases.ml b/src/client/client_aliases.ml index 4e9d2b8bf..1a80cc78c 100644 --- a/src/client/client_aliases.ml +++ b/src/client/client_aliases.ml @@ -177,18 +177,18 @@ module Alias = functor (Entity : Entity) -> struct include Entity - let alias_param ?(name = "name") ?(desc = "existing " ^ name ^ " alias") next = + let alias_param ?(name = "name") ?(desc = "existing " ^ Entity.name ^ " alias") next = param ~name ~desc (fun cctxt s -> find cctxt s >>= fun v -> return (s, v)) next - let fresh_alias_param ?(name = "new") ?(desc = "new " ^ name ^ " alias") next = + let fresh_alias_param ?(name = "new") ?(desc = "new " ^ Entity.name ^ " alias") next = param ~name ~desc (fun cctxt s -> load cctxt >>= fun list -> if not Client_config.force#get then Lwt_list.iter_s (fun (n, _v) -> - if n = name then + if n = s then cctxt.Client_commands.error "the %s alias %s already exists, use -force true to update" Entity.name n else return ()) @@ -197,7 +197,7 @@ module Alias = functor (Entity : Entity) -> struct else return s) next - let source_param ?(name = "src") ?(desc = "source " ^ name) next = + let source_param ?(name = "src") ?(desc = "source " ^ Entity.name) next = let desc = desc ^ "\n" ^ "can be an alias, file or literal (autodetected in this order)\n\ diff --git a/src/utils/cli_entries.ml b/src/utils/cli_entries.ml index b9381f15c..a83a6f3e1 100644 --- a/src/utils/cli_entries.ml +++ b/src/utils/cli_entries.ml @@ -291,12 +291,12 @@ let usage Format.pp_print_text desc help_args params ; end ; - if options = [] then + if args = [] then Format.fprintf ppf "@]" else Format.fprintf ppf "@,%a@]" (Format.pp_print_list option_help) - options in + args in let rec group_help ppf ({ title }, commands) = Format.fprintf ppf "@[%s:@,%a@]" title