2 Commits
0.0.2 ... 0.0.3

Author SHA1 Message Date
Alexey Golub
2a76dfe1c8 Update version 2019-08-20 18:12:33 +03:00
Alexey Golub
59ee2e34d8 Don't add abstract and interface types that implement ICommand 2019-08-20 18:12:22 +03:00
2 changed files with 4 additions and 2 deletions

View File

@@ -38,7 +38,9 @@ namespace CliFx
{ {
commandAssembly.GuardNotNull(nameof(commandAssembly)); commandAssembly.GuardNotNull(nameof(commandAssembly));
var commandTypes = commandAssembly.ExportedTypes.Where(t => t.Implements(typeof(ICommand))); var commandTypes = commandAssembly.ExportedTypes
.Where(t => t.Implements(typeof(ICommand)))
.Where(t => !t.IsAbstract && !t.IsInterface);
foreach (var commandType in commandTypes) foreach (var commandType in commandTypes)
AddCommand(commandType); AddCommand(commandType);

View File

@@ -3,7 +3,7 @@
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net45;netstandard2.0</TargetFrameworks> <TargetFrameworks>net45;netstandard2.0</TargetFrameworks>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<Version>0.0.2</Version> <Version>0.0.3</Version>
<Company>Tyrrrz</Company> <Company>Tyrrrz</Company>
<Authors>$(Company)</Authors> <Authors>$(Company)</Authors>
<Copyright>Copyright (C) Alexey Golub</Copyright> <Copyright>Copyright (C) Alexey Golub</Copyright>