CurtHagenlocher commented on code in PR #83:
URL: https://github.com/apache/arrow-dotnet/pull/83#discussion_r2383023874


##########
test/Apache.Arrow.Flight.IntegrationTest/Program.cs:
##########
@@ -23,45 +25,61 @@ public static class Program
 {
     public static async Task<int> Main(string[] args)
     {
-        var portOption = new Option<int>(
-            new[] { "--port", "-p" },
-            description: "Port the Flight server is listening on");
-        var scenarioOption = new Option<string>(
-            new[] { "--scenario", "-s" },
-            "The name of the scenario to run");
-        var pathOption = new Option<FileInfo>(
-            new[] { "--path", "-j" },
-            "Path to a JSON file of test data");
-
-        var rootCommand = new RootCommand(
-            "Integration test application for Apache.Arrow .NET Flight.");
+        var portOption = new Option<int>("--port", "-p")
+        {
+            Description = "Port the Flight server is listening on",
+        };
+        var scenarioOption = new Option<string>("--scenario", "-s")
+        {
+            Description = "The name of the scenario to run",
+        };
+        var pathOption = new Option<FileInfo>("--path", "-j")
+        {
+            Description = "Path to a JSON file of test data",
+        };
 
         var clientCommand = new Command("client", "Run the Flight client")
         {
             portOption,
             scenarioOption,
             pathOption,
         };
-        rootCommand.AddCommand(clientCommand);
-
-        clientCommand.SetHandler(async (port, scenario, jsonFile) =>
+        clientCommand.SetAction(async (parseResult, cancellationToken) =>
         {
-            var command = new FlightClientCommand(port, scenario, jsonFile);
+            var command = new FlightClientCommand(
+                parseResult.GetValue(portOption),
+                parseResult.GetValue(scenarioOption),
+                parseResult.GetValue(pathOption));
             await command.Execute().ConfigureAwait(false);
-        }, portOption, scenarioOption, pathOption);
+        });
 
         var serverCommand = new Command("server", "Run the Flight server")
         {
             scenarioOption,
         };
-        rootCommand.AddCommand(serverCommand);
-
-        serverCommand.SetHandler(async scenario =>
+        serverCommand.SetAction(async (parseResult, cancellationToken) =>
         {
-            var command = new FlightServerCommand(scenario);
+            var command = new FlightServerCommand(
+                parseResult.GetValue(scenarioOption));
             await command.Execute().ConfigureAwait(false);
-        }, scenarioOption);
+        });

Review Comment:
   Go home, Copilot; you're drunk.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to