Implement Zero value for computation expression.
Would it be possible to implement the Zero value for the cli computation expression? This is needed for letting other values be added conditionally.
In my current process, I'm trying to add the output logging if the user specifies a log file. and it would allow the following to happen
cli {
Command "command"
Arguments ["arg1"; "arg2"]
if logPath.isSome then
Output logPath.Value
}
Thank you, that looks doable. 😊
Hey @AlexStory,
I was playing around with the Zero function in CEs.
Unfortunately, it's not possible to implement it in Fli.
I can offer you another thing where I need to fix something anyways:
a condition beforehand or inline:
let output = if logPath.isSome then logPath.Value else ""
cli {
Command "command"
Arguments ["arg1"; "arg2"]
Output output // or inline condition
}
What do you think?
For my personal case that would work, if Output "" is treated the same as just not having an Output
Yes, it would be like that.
This change has been pushed to Nuget in version v1.111.10. Thank you for your patience. 🙂