Skip to content

Unable to register non-generic command #77

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
Matthiee opened this issue Sep 12, 2020 · 1 comment
Closed

Unable to register non-generic command #77

Matthiee opened this issue Sep 12, 2020 · 1 comment
Assignees
Labels
bug Something isn't working Customer Reported Bugs reported by customers enhancement New feature or request
Milestone

Comments

@Matthiee
Copy link
Member

Matthiee commented Sep 12, 2020

Assume you have the following command:

public class MyCommand : Abstractions.Command.Command
{
   // ...
}

In this case it is impossible to use the following commands

var parser = new CommandLineParser();

parser.RegisterCommand<MyCommand>();

// or

parser.RegisterCommand(typeof(MyCommand));

// or

parser.DiscoverCommands(typeof(MyCommand).Assembly);
@Matthiee Matthiee added bug Something isn't working enhancement New feature or request Customer Reported Bugs reported by customers labels Sep 12, 2020
@Matthiee Matthiee added this to the 0.4 milestone Sep 12, 2020
@Matthiee Matthiee self-assigned this Sep 12, 2020
Matthiee added a commit that referenced this issue Sep 13, 2020
* Allow non generic commands to be registered (#77)

* Refactor RegisterCommand<TCommand>

* Allow non generic commands to be discovered
@Matthiee
Copy link
Member Author

Matthiee commented Sep 13, 2020

Merged in (#78)

Matthiee added a commit that referenced this issue Sep 16, 2020
* Allow non generic commands to be registered using models fixes #82 and improves #77

* Fix issue with registering non generic sub command
Matthiee added a commit that referenced this issue Sep 20, 2020
* Improve Dependency Injection (#71)

* Rename to BaseArgumentResolver

* Add resolvers as part of DI

* Remove obsolete IArgumentResolverFactory

* Remove IContainerResolver will be replaced with IServiceProvider

* Use IServiceProvider for resolving fixes #70

* Update readme

* Add more services to the ServiceCollection

* Use DI in printer tests

* Add IUsagePrinter to interface

* Improve DI flow

* Use ActivatorUtilities to instantiate CommandLineOption

* Use CreateInstance instead of newing up a new instance.

* Improve extension method to allow chaining

* Add basic logger

* Add logger service in tests

* Add logging in all tests!

* Allow non generic command to be registered (#78)

* Allow non generic commands to be registered (#77)

* Refactor RegisterCommand<TCommand>

* Allow non generic commands to be discovered

* Register non generic command using model (#83)

* Allow non generic commands to be registered using models fixes #82 and improves #77

* Fix issue with registering non generic sub command

* Remove IgnoreAttribute fixes #80 (#84)

* Update version to 0.4

* Bump FluentValidation from 8.5.1 to 9.2.2 (#86)

* Bump FluentValidation from 8.5.1 to 9.2.2

Bumps [FluentValidation](https://github.com/JeremySkinner/fluentvalidation) from 8.5.1 to 9.2.2.
- [Release notes](https://github.com/JeremySkinner/fluentvalidation/releases)
- [Changelog](https://github.com/FluentValidation/FluentValidation/blob/master/Changelog.txt)
- [Commits](FluentValidation/FluentValidation@8.5.1...9.2.2)

Signed-off-by: dependabot[bot] <support@github.com>

* Fix build, upgrade fluent validation https://docs.fluentvalidation.net/en/latest/upgrading-to-9.html

* bump version in nuspec

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matthias Beerens <3512339+Matthiee@users.noreply.github.com>

* Cleanup 0.4 release (#85)

* Refactor InitializeModel into seperate class

* Split complex ParseOptions method

* Add braces

* Split complex ParseCommands and ParseCommandsAsync method

* Refactor if statements in HelpRequested method

* Remove redundant assignment

* Remove unused usings

* Revert returning help requested state to caller

* Improve if statements

* Add xml comment

* Add more xml documentation

* Add validator xml comments

* Update sample app

* Improve test coverage

* Add xml comment

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working Customer Reported Bugs reported by customers enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant