Skip to content

Commit

Permalink
experimenting with dotnet-suggest
Browse files Browse the repository at this point in the history
  • Loading branch information
leandromonaco committed Jan 21, 2025
1 parent 77bfe33 commit c16b896
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
10 changes: 7 additions & 3 deletions src/DevEx.Console/Program.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
using System.CommandLine;
using System.CommandLine.Builder;
using System.CommandLine.Parsing;
using DevEx.Core;

var rootCommand = new RootCommand();

PluginService.LoadPlugins(rootCommand);

return await rootCommand.InvokeAsync(args);


var builder = new CommandLineBuilder(rootCommand)
.UseDefaults()
.UseSuggestDirective();

var parser = builder.Build();
return await parser.InvokeAsync(args);
2 changes: 1 addition & 1 deletion src/DevEx.Core/PluginService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static void LoadPlugins(RootCommand rootCommand)
{
if (Activator.CreateInstance(type) is IPlugin plugin)
{
#if !DEBUG
#if DEBUG
Console.WriteLine($"Loading plugin: {plugin.Name} - {plugin.Description}");
#endif
var command = plugin.GetCommand();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="9.0.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\DevEx.Core\DevEx.Core.csproj" />
</ItemGroup>
Expand Down

0 comments on commit c16b896

Please sign in to comment.