8000 withPossibleFallback method · Issue #190 · scopt/scopt · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

withPossibleFallback method #190

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

Open
jregistr opened this issue Jun 12, 2018 · 1 comment
Open

withPossibleFallback method #190

jregistr opened this issue Jun 12, 2018 · 1 comment

Comments

@jregistr
Copy link

I think it'd be helpful to have a withPossibleFallback method.
The use case is if I want to calculate a fallback but with the option of failing and showing usage information.

ex: I wanted to fallback to using and env variable but also then do some validation on the env.

Perhaps this is currently possible and I just didn't notice how to?

@hussachai
Copy link

+1 I have kind of similar use case.
However, if breaking change is ok, I'd prefer having withFallback that takes arg of either Function1[Unit, Option[A]] or Function1[Unit, Try[A]].
Let me know what you guys think. I can create a PR if this is a good change as well.

2m pushed a commit to 2m/scopt that referenced this issue Feb 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0