Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Zero value for computation expression. #69

Closed
AlexStory opened this issue Apr 29, 2024 · 5 comments · Fixed by #72
Closed

Implement Zero value for computation expression. #69

AlexStory opened this issue Apr 29, 2024 · 5 comments · Fixed by #72
Labels
feature Feature to implement

Comments

@AlexStory
Copy link

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
}
@CaptnCodr
Copy link
Owner

Thank you, that looks doable. 😊

@CaptnCodr CaptnCodr added the feature Feature to implement label Apr 30, 2024
@CaptnCodr
Copy link
Owner

CaptnCodr commented May 28, 2024

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?

@AlexStory
Copy link
Author

For my personal case that would work, if Output "" is treated the same as just not having an Output

@CaptnCodr
Copy link
Owner

CaptnCodr commented May 28, 2024

Yes, it would be like that.

@CaptnCodr
Copy link
Owner

This change has been pushed to Nuget in version v1.111.10.
Thank you for your patience. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature to implement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants