Skip to content

Commit c38ee13

Browse files
fix the examples in README.md (#89)
1 parent bf31b84 commit c38ee13

1 file changed

Lines changed: 17 additions & 17 deletions

File tree

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ let main args = async {
2727
|> Cli.workDir "~/src/CliWrap.FSharp"
2828
|> Cli.exec
2929
30-
result.ExitCode
30+
return result.ExitCode
3131
}
3232
```
3333

@@ -42,7 +42,7 @@ let main args = task {
4242
|> Cli.workDir "~/src/CliWrap.FSharp"
4343
|> Cli.Task.exec cts.Token
4444
45-
result.ExitCode
45+
return result.ExitCode
4646
}
4747
```
4848

@@ -56,7 +56,7 @@ let main args = task {
5656
|> Cli.workDir "~/src/CliWrap.FSharp"
5757
|> Cli.Task.execf forceful.Token graceful.Token
5858
59-
result.ExitCode
59+
return result.ExitCode
6060
}
6161
```
6262

@@ -66,8 +66,8 @@ It attempts to mimic the builder pattern and `.With*` style methods.
6666
```fsharp
6767
let main args =
6868
let cmd = command "dotnet" {
69-
args = [ "build" ]
70-
workingDirectory = "~/src/CliWrap.FSharp"
69+
args [ "build" ]
70+
workingDirectory "~/src/CliWrap.FSharp"
7171
}
7272
7373
cmd.ExecuteAsync()
@@ -78,12 +78,12 @@ The computation expression also supports executing the command with `exec`.
7878
```fsharp
7979
let main args = task {
8080
let! result = command "dotnet" {
81-
args = [ "build" ]
82-
workingDirectory = "~/src/CliWrap.FSharp"
81+
args [ "build" ]
82+
workingDirectory "~/src/CliWrap.FSharp"
8383
exec
8484
}
8585
86-
result.ExitCode
86+
return result.ExitCode
8787
}
8888
```
8989

@@ -93,12 +93,12 @@ Cancellation is also supported.
9393
let main args = task {
9494
use cts = new CancellationTokenSource()
9595
let! result = command "dotnet" {
96-
args = [ "build" ]
97-
workingDirectory = "~/src/CliWrap.FSharp"
96+
args [ "build" ]
97+
workingDirectory "~/src/CliWrap.FSharp"
9898
exec cts.Token
9999
}
100100
101-
result.ExitCode
101+
return result.ExitCode
102102
}
103103
```
104104

@@ -108,12 +108,12 @@ CliWrap's buffered execution is supported with `buffered`.
108108
let main args = task {
109109
use cts = new CancellationTokenSource()
110110
let! result = command "dotnet" {
111-
args = [ "build" ]
112-
workingDirectory = "~/src/CliWrap.FSharp"
111+
args [ "build" ]
112+
workingDirectory "~/src/CliWrap.FSharp"
113113
buffered Encoding.UTF8 cts.Token
114114
}
115115
116-
result.ExitCode
116+
return result.ExitCode
117117
}
118118
```
119119

@@ -123,12 +123,12 @@ Asynchrony with F#'s `Async<'T>` is supported with `async`.
123123
let main args = async {
124124
use cts = new CancellationTokenSource()
125125
let! result = command "dotnet" {
126-
args = [ "build" ]
127-
workingDirectory = "~/src/CliWrap.FSharp"
126+
args [ "build" ]
127+
workingDirectory "~/src/CliWrap.FSharp"
128128
async cts.Token
129129
}
130130
131-
result.ExitCode
131+
return result.ExitCode
132132
}
133133
```
134134

0 commit comments

Comments
 (0)