From 45547169d36822417a1eee14313ce224299ea1da Mon Sep 17 00:00:00 2001 From: Shon Feder Date: Fri, 1 Jan 2021 11:49:54 -0500 Subject: [PATCH] Add inline docs for --terminal-persistence modes Signed-off-by: Shon Feder --- bin/common.ml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/bin/common.ml b/bin/common.ml index d85d073aed2..4ba48239209 100644 --- a/bin/common.ml +++ b/bin/common.ml @@ -487,14 +487,19 @@ let term = [ "debug-artifact-substitution" ] ~docs ~doc:"Print debugging info about artifact substitution") and+ terminal_persistence = + let modes = Config.Terminal_persistence.all in + let doc = + let f s = fst s |> Printf.sprintf "$(b,%s)" in + Printf.sprintf + {|Changes how the log of build results are displayed to the + console between rebuilds while in $(b,--watch) mode. Supported modes: + %s.|} + (List.map ~f modes |> String.concat ~sep:", ") + in Arg.( value - & opt (some (enum Config.Terminal_persistence.all)) None - & info [ "terminal-persistence" ] ~docs ~docv:"MODE" - ~doc: - {| - Changes how the log of build results are displayed to the - console between rebuilds while in --watch mode. |}) + & opt (some (enum modes)) None + & info [ "terminal-persistence" ] ~docs ~docv:"MODE" ~doc) and+ display = display_term and+ no_buffer = let doc =