diff --git a/bin/promotion.ml b/bin/promotion.ml index 9d5bd00fc86..afc9ed1c52d 100644 --- a/bin/promotion.ml +++ b/bin/promotion.ml @@ -128,9 +128,7 @@ module Show = struct List.iter present ~f:(fun file -> let correction_file = Diff_promotion.File.correction_file file in if Path.exists correction_file - then ( - let contents = Io.read_file correction_file in - Console.printf "%s" contents) + then Io.read_file correction_file |> print_endline else User_warning.emit [ Pp.textf @@ -142,11 +140,12 @@ module Show = struct let term = let+ builder = Common.Builder.term and+ files = + (* CR-someday rgrinberg: should we really allow more than one file? How + are users supposed to distinguish the output? *) Arg.(value & pos_all Cmdliner.Arg.file [] & info [] ~docv:"FILE" ~doc:None) in let common, _config = Common.init builder in let files_to_promote = files_to_promote ~common files in - (* CR-soon rgrinberg: remove pointless args *) let db = Diff_promotion.load_db () in let { Diff_promotion.present = _; missing } = Diff_promotion.partition_db db files_to_promote diff --git a/doc/changes/fixed/13481.md b/doc/changes/fixed/13481.md new file mode 100644 index 00000000000..3473f874e42 --- /dev/null +++ b/doc/changes/fixed/13481.md @@ -0,0 +1,2 @@ +- Print `$ dune promotion show` output to stdout rather than stderr (#13481, + @rgrinberg)