-
Notifications
You must be signed in to change notification settings - Fork 395
Introduce more than 7 arguments in System.CommandLine.Invocation.CommandHandler.Create
#983
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
Comments
I've run into this exact same issue and would be interested in finding out if there's a workaround for this. |
The model binder also supports binding to complex types. You can see more details here: https://github.com/dotnet/command-line-api/blob/master/docs/model-binding.md#more-complex-types |
That looks exactly like what I needed. Not sure how I missed it in the docs. Thanks @jonsequitur. |
@jonsequitur shouldn't that article be referenced from the home page? I also missed it, especially since the referenced article "Argument validation and binding" does not make a visible reference to complex type binding. (Should I make a PR for the homepage or extend the article "Argument ..."?) |
@jonsequitur it still wouldn't harm to add more arguments to |
I mean, we could go to 11... Do you have a preference for more arguments versus complex model binding? The documentation could use some help though. We've just started trying to consolidate and reorganize the docs, and we want to make a push to add XML comments as well. PRs are more than welcome. |
* Refer to complex binding in howto This patch adds a reference in "How-to" page to point the readers to the relevant section about how to bind the more complex types. Since "Model binding" page is not directly referenced from the Readme, many readers are not aware of it. This is related to issue #983.
This patch fixes `System.CommandLine.Invocation.CommandHandler.Create` so that it can handle actions with up to 11 arguments. Current limit of 7 arguments is not enough for a more complex applications. While users can alternatively bind arguments to arbitrary number of properties, this requires refactoring the code once the limit is hit. Additionally, some users are not aware of the feature and could hit the wall unintentionally. With this patch, the arbitrary, but reasonable limit of 11 arguments should cover most of the use cases "in the wild". Fix #983.
Hi,
I noticed that the
CommandHandler.Create
is limited to at most 7 arguments of the action. This corresponds to at most 7 options, which is a bit too little in a more complex applications.Was there a reason for this limit (instead of pushing it higher to, say, 16)? What is your suggested way to handle more than 7 options?
Thanks a lot for the answers in advance! Please let me know if I should create a pull request to introduce a higher limit if there is no particular reason for the current one.
The text was updated successfully, but these errors were encountered: