Skip to content
Draft
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.6" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.6" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.6" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta5.25277.114" />
</ItemGroup>

<ItemGroup>
Expand Down
21 changes: 11 additions & 10 deletions src/GenAIDBExplorer/GenAIDBExplorer.Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ internal static class Program
/// The main method that sets up and runs the application.
/// </summary>
/// <param name="args">The command-line arguments.</param>
private static async Task Main(string[] args)
private static async Task<int> Main(string[] args)
{
// Create the root command with a description
var rootCommand = new RootCommand("GenAI Database Explorer console application");
Expand All @@ -25,15 +25,16 @@ private static async Task Main(string[] args)
.Build();

// Set up commands
rootCommand.AddCommand(InitProjectCommandHandler.SetupCommand(host));
rootCommand.AddCommand(DataDictionaryCommandHandler.SetupCommand(host));
rootCommand.AddCommand(EnrichModelCommandHandler.SetupCommand(host));
rootCommand.AddCommand(ExportModelCommandHandler.SetupCommand(host));
rootCommand.AddCommand(ExtractModelCommandHandler.SetupCommand(host));
rootCommand.AddCommand(QueryModelCommandHandler.SetupCommand(host));
rootCommand.AddCommand(ShowObjectCommandHandler.SetupCommand(host));
rootCommand.Subcommands.Add(InitProjectCommandHandler.SetupCommand(host));
rootCommand.Subcommands.Add(DataDictionaryCommandHandler.SetupCommand(host));
rootCommand.Subcommands.Add(EnrichModelCommandHandler.SetupCommand(host));
rootCommand.Subcommands.Add(ExportModelCommandHandler.SetupCommand(host));
rootCommand.Subcommands.Add(ExtractModelCommandHandler.SetupCommand(host));
rootCommand.Subcommands.Add(QueryModelCommandHandler.SetupCommand(host));
rootCommand.Subcommands.Add(ShowObjectCommandHandler.SetupCommand(host));

// Invoke the root command
await rootCommand.InvokeAsync(args);
// Invoke the root command using new parsing and invocation separation
var parseResult = rootCommand.Parse(args);
return await parseResult.InvokeAsync();
}
}