File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11module Program
22
33open FSharp.SystemCommandLine
4- open System.CommandLine .Invocation
54
6- let app ( ctx : InvocationContext , words : string array , separator : string option ) =
5+ let app ( words : string array , separator : string option ) =
76 let separator = separator |> Option.defaultValue " , "
87 System.String.Join( separator, words) |> printfn " Result: %s "
9- ctx.ExitCode <- 1
8+ 0
109
1110[<EntryPoint>]
1211let main argv =
13- let ctx = Input.InjectedDependency()
1412 let words = Input.Option([ " --word" ; " -w" ], Array.empty, " A list of words to be appended" )
1513 let separator = Input.OptionMaybe([ " --separator" ; " -s" ], " A character that will separate the joined words." )
1614
1715 rootCommand argv {
1816 description " Appends words together"
19- inputs ( ctx , words, separator)
17+ inputs ( words, separator)
2018 setHandler app
2119 }
You can’t perform that action at this time.
0 commit comments