Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion DevProxy/Commands/DevProxyCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,18 @@ private void ConfigureCommand()
ActivatorUtilities.CreateInstance<StopCommand>(_serviceProvider),
ActivatorUtilities.CreateInstance<LogsCommand>(_serviceProvider)
};
commands.AddRange(_plugins.SelectMany(p => p.GetCommands()));
var pluginCommands = _plugins.SelectMany(p => p.GetCommands());
foreach (var group in pluginCommands.GroupBy(c => c.Name))
{
var command = group.First();
commands.Add(command);
if (group.Count() > 1)
{
_logger.LogWarning(
"Multiple plugins register the '{CommandName}' command. Only the first registration will be used",
command.Name);
}
}
this.AddCommands(commands.OrderByName());

HelpExamples.Add(this, [
Expand Down
Loading