You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve whitespace in ExitCodeExceptionShow instance
Split off of #83.
Before, `ProcessConfig`'s `Show` output would include a trailing
newline. This has been fixed, so that derived `Show` output does not
include newlines in weird places.
Before:
ghci> data Foo = Foo { a :: Int, b :: ProcessConfig () () (), c :: String } deriving Show
ghci> Foo 1 (proc "echo" ["puppy"]) "doggy"
Foo {a = 1, b = Raw command: echo puppy
, c = "doggy"}
After
ghci> Foo 1 (proc "echo" ["puppy"]) "doggy"
Foo {a = 1, b = Raw command: echo puppy, c = "doggy"}
Whitespace for the `ExitCodeException` `Show` instance has also been
adjusted, to place the output closer to the relevant headers.
Before:
ghci> readProcess_ $ proc "sh" ["-c", "echo this is stdout; echo this is stderr >&2; false"]
*** Exception: Received ExitFailure 1 when running
Raw command: sh -c "echo this is stdout; echo this is stderr >&2; false"
Standard output:
this is stdout
Standard error:
this is stderr
After:
*** Exception: Received ExitFailure 1 when running
Raw command: sh -c "echo this is stdout; echo this is stderr >&2; false"
Standard output:
this is stdout
Standard error:
this is stderr
Note that because trailing whitespace is not accounted for, it is still
possible to get unintuitive results depending on what exactly the
subprocess prints:
ghci> readProcess_ $ proc "sh" ["-c", "echo -n this is stdout; echo -n this is stderr >&2; false"]
*** Exception: Received ExitFailure 1 when running
Raw command: sh -c "echo -n this is stdout; echo -n this is stderr >&2; false"
Standard output:
this is stdout
Standard error:
this is stderr
0 commit comments