chshersh / iris

🌈 Haskell CLI Framework supporting Command Line Interface Guidelines
https://hackage.haskell.org/package/iris
Mozilla Public License 2.0
176 stars 21 forks source link

Write a test that global parsing doesn't conflict with local parsing #59

Closed chshersh closed 1 year ago

chshersh commented 2 years ago

Similar to #56

People shouldn't specify options that conflict with ours. But if they still do, it would be nice to know whether their parsing conflicts with ours. So I propose to add two tests and document their results in public API:

zetkez commented 1 year ago

Hi, i want to take this one as my first task. I found a breaking case that is when the custom parser defines --no-input [TARGET] while being a mandatory option. Defined like this the app always displays the help/error message "expected: ...". I assume this is the second case of the listing above. Should i still assume this as the wanted behavior? And does it make sense to add the tests before #67 as i would define custom CliEnvSettings with a custom parser?

chshersh commented 1 year ago

@zetkez Feel free to give it a go! All CLI tests can be found in this module (and can be added here for now):

I believe, it makes sense to test several combinations:

Once we have these 3 test cases, we can improve the documentation to reflect this behaviour 🙂 The point of this issue is not to fix the behaviour but to discover what is the actual existing behavior and document it for our users.

Hope that helps!