Skip to content

Commit c13aee6

Browse files
author
flsl0
committed
Add an hint in the README to guide the user on the effect of using the stream option and how to fix it
1 parent c691a10 commit c13aee6

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,17 @@ cli {
116116
}
117117
|> Command.execute
118118
```
119+
Hint: Using `Output (new StreamWriter(...))` will redirect the output text to your desired target and not save it into `Output.Text` nor `Output.Error` but in order to fix that you can use `Output.from`:
120+
```fsharp
121+
let sb = StringBuilder()
122+
cli {
123+
Exec "dotnet"
124+
Arguments "--list-sdks"
125+
Output (new StringWriter(sb))
126+
}
127+
|> Command.execute
128+
|> Output.from (sb.ToString())
129+
```
119130

120131
Add environment variables for the executing program:
121132
```fsharp

0 commit comments

Comments
 (0)