File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -56,18 +56,18 @@ let main () =
5656 | "format-codeblocks" :: rest -> (
5757 match rest with
5858 | [" -h" ] | [" --help" ] -> logAndExit (Ok formatDocstringsHelp)
59- | [path; " --stdout" ] -> (
59+ | path :: args -> (
60+ let isStdout = List. mem " --stdout" args in
61+ let outputMode = if isStdout then `Stdout else `File in
6062 Clflags. color := Some Misc.Color. Never ;
6163 match
62- Tools.FormatCodeblocks. formatCodeBlocksInFile ~output Mode:`Stdout
63- ~entry PointFile:path
64+ ( Tools.FormatCodeblocks. formatCodeBlocksInFile ~output Mode
65+ ~entry PointFile:path,
66+ outputMode )
6467 with
65- | Ok content -> print_endline content
66- | Error e -> logAndExit (Error e))
67- | [path] ->
68- Tools.FormatCodeblocks. formatCodeBlocksInFile ~output Mode:`File
69- ~entry PointFile:path
70- |> logAndExit
68+ | Ok content , `Stdout -> print_endline content
69+ | result , `File -> logAndExit result
70+ | Error e , _ -> logAndExit (Error e))
7171 | _ -> logAndExit (Error formatDocstringsHelp))
7272 | "reanalyze" :: _ ->
7373 let len = Array. length Sys. argv in
You can’t perform that action at this time.
0 commit comments