diff --git a/src/bin_client/client_main_run.ml b/src/bin_client/client_main_run.ml index 48c57a06d..090346c7a 100644 --- a/src/bin_client/client_main_run.ml +++ b/src/bin_client/client_main_run.ml @@ -75,6 +75,20 @@ let make_context block base_dir rpc_config = method block = block end +let builtin_commands = + let open Cli_entries in + [ + command + ~desc: "List the protocol versions that this client understands." + no_options + (fixed [ "list" ; "understood" ; "protocols" ]) + (fun () (cctxt : #Client_context.full_context) -> + Lwt_list.iter_s + (fun (ver, _) -> cctxt#message "%a" Protocol_hash.pp_short ver) + (Client_commands.get_versions ()) >>= fun () -> + return ()) ; + ] + (* Main (lwt) entry *) let main select_commands = let executable_name = Filename.basename Sys.executable_name in @@ -117,7 +131,7 @@ let main select_commands = ~global_options (if Unix.isatty Unix.stdout then Cli_entries.Ansi else Cli_entries.Plain) Format.std_formatter - (config_commands @ commands) in + (config_commands @ builtin_commands @ commands) in let rpc_config = if parsed_args.print_timings then { rpc_config with diff --git a/src/bin_client/client_rpc_commands.ml b/src/bin_client/client_rpc_commands.ml index 126fd5c30..993363adb 100644 --- a/src/bin_client/client_rpc_commands.ml +++ b/src/bin_client/client_rpc_commands.ml @@ -425,16 +425,6 @@ let group = let commands = [ - command - ~desc: "List the protocol versions that this client understands." - no_options - (fixed [ "list" ; "versions" ]) - (fun () (cctxt : #Client_context.full_context) -> - Lwt_list.iter_s - (fun (ver, _) -> cctxt#message "%a" Protocol_hash.pp_short ver) - (Client_commands.get_versions ()) >>= fun () -> - return ()) ; - command ~group ~desc: "List RPCs under a given URL prefix.\n\ Some parts of the RPC service hierarchy depend on parameters,\n\