Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib_eio/process.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions tests/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down