-
Notifications
You must be signed in to change notification settings - Fork 32
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
Combine positional and flag based arguments #18
Comments
I think the fix here is to change the instances for tuples from this: instance (ParseFields a, ParseFields b) => ParseRecord (a, b) ... to this: instance (ParseRecord a, ParseRecord b) => ParseRecord (a, b) ... and likewise for other tuple instances. Then the types How does that sound? |
Hmm, I don't think that would really solve my issue, I just realized that my example might not have been the best. A more accurate example could look something like this:
though I suppose I could restructure it so that |
Yeah, in general what you want to do is probably not going to work. For example, consider the case where |
For cases like that you will probably have to hand-write the top-level parser to do what you want |
Addressing both examples you've given:
Currently, it seems like any nested type gets displayed as Both nested subcommands and positional + flag based arguments are important for cli tools, I'd be happy to take a stab at implementing these if you feel it's worth supporting. |
If you think there is a clean way to implement this then I'll be happy to review it |
I'm trying to combine both positional and flag based arguments, I've tried embedding a record in a normal constructor like so:
While the parser is correct, the help message is fairly useless:
What I'd like to get is:
I don't understand haskell generic programming well enough to provide the correct instances though.
The text was updated successfully, but these errors were encountered: