-
Notifications
You must be signed in to change notification settings - Fork 525
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
WIP: Separate args for each command #551
WIP: Separate args for each command #551
Conversation
| Some x -> x | ||
| _ -> "" | ||
match args with | ||
| "add" :: args -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did we loose the nice discriminated union case here?
@mexx what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually neither version looks good to me.
The old one do not support our use case for having separate argument for each command well.
The new one tries to provide the desired behavior but introduces redundancy and magic values.
I have to look further into Nessos.UnionArgParser
to see how we can do better here.
I'll try to look at it on this weekend.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm I'll see what I can do to bring the Commands DU back. @mexx what type of redundancy? You mean arguments that are applicable to more than one command?
Yes I think making the args more explicit per command is a good thing. |
9e14d29
to
a7c5685
Compare
I added the Command DU - does it look any better now? |
|
||
if results.IsUsageRequested then | ||
trace <| results.Usage("paket config") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not showHelp HelpTexts.commands.["config"]
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no "config" in this dictionary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was the actual implementation. Congratulations, you found a bug ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, indeed, didn't notice that one ;)
Looks a little bit better now. With this version of |
WIP: Separate args for each command
Because Paket.exe is always to be invoked with a given command, I thought it would be nice to separate arguments for each of the commands.
Tell me what you think, if you give green light I'll proceed with filling up the usages, and what else gives.