-
Notifications
You must be signed in to change notification settings - Fork 33
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
Make mainBody
behavior the default when parsing args
#65
Comments
This does seem to be a common source of confusion, so it's definitely something I want to improve. To answer your question, though, here's what I posted in an almost identical issue yesterday:
Given that, I am somewhat reluctant to have the default behavior be "make my code hard to test". |
Duplicate of #64 |
Thanks for detailing it out. Though, I personally would consider an easy and intuitive usage more important than testability. Btw, what I did for https://github.com/holgerbrandl/kscript which suffers from a similar conceptual problem was to combine jvm-unit-testing with integration-level tests (error, exit codes) using |
It took me quite a while (and frustration) to realize that my naive way of setting up a parser with
wont give any help by default unless I wrap it with
Why can't
parseInto
catch the exception by default and print the help (similar to howmainBody
works). Requiring a lambda here seems too much. A boolean parameter such ascatchEx
or similar (defaulting to totrue
) forparseInto
seems more intuitive to me.The text was updated successfully, but these errors were encountered: