diff --git a/lib_eio/process.ml b/lib_eio/process.ml index dce3f84c8..587db13a4 100644 --- a/lib_eio/process.ml +++ b/lib_eio/process.ml @@ -97,7 +97,7 @@ let bad_char = function c <= 32 || c >= 127 let pp_arg f x = - if x = "" || String.exists bad_char x then Fmt.(quote string) f x + if x = "" || String.exists bad_char x then Fmt.pf f "%S" x else Fmt.string f x let pp_args = Fmt.hbox (Fmt.list ~sep:Fmt.sp pp_arg) diff --git a/tests/process.md b/tests/process.md index b3baedfc5..165c461e0 100644 --- a/tests/process.md +++ b/tests/process.md @@ -145,10 +145,10 @@ If a command fails, we get shown the arguments (quoted if necessary): ```ocaml # run @@ fun mgr env -> - Process.run mgr ["bash"; "-c"; "exit 3"; ""; "foo"];; + Process.run mgr ["bash"; "-c"; "exit 3"; ""; "foo"; "\"bar\""];; Exception: Eio.Io Process Child_error Exited (code 3), - running command: bash -c "exit 3" "" foo + running command: bash -c "exit 3" "" foo "\"bar\"" ``` Exit code success can be determined by is_success (Process.run):