mirror of
https://github.com/Tyrrrz/CliFx.git
synced 2025-10-25 15:19:17 +00:00
Make CommandAttribute non-optional on command types
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using CliFx.Attributes;
|
||||
using CliFx.Internal;
|
||||
using CliFx.Models;
|
||||
using CliFx.Services;
|
||||
@@ -40,6 +41,7 @@ namespace CliFx
|
||||
|
||||
var commandTypes = commandAssembly.ExportedTypes
|
||||
.Where(t => t.Implements(typeof(ICommand)))
|
||||
.Where(t => t.IsDefined(typeof(CommandAttribute)))
|
||||
.Where(t => !t.IsAbstract && !t.IsInterface);
|
||||
|
||||
foreach (var commandType in commandTypes)
|
||||
|
||||
Reference in New Issue
Block a user