You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by je...@apache.org on 2019/11/23 21:33:56 UTC
[thrift] branch master updated: THRIFT-5026 TestClient/Server
ignores first cmdline argument Client: netstd Patch: Jens Geyer
This is an automated email from the ASF dual-hosted git repository.
jensg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/thrift.git
The following commit(s) were added to refs/heads/master by this push:
new b541c6f THRIFT-5026 TestClient/Server ignores first cmdline argument Client: netstd Patch: Jens Geyer
b541c6f is described below
commit b541c6f2b126219867963c8b577b4c08d72e866d
Author: Jens Geyer <je...@apache.org>
AuthorDate: Sat Nov 23 18:50:22 2019 +0100
THRIFT-5026 TestClient/Server ignores first cmdline argument
Client: netstd
Patch: Jens Geyer
This closes #1945
---
test/netstd/Client/Program.cs | 16 ++++------------
test/netstd/Server/Program.cs | 16 ++++------------
2 files changed, 8 insertions(+), 24 deletions(-)
diff --git a/test/netstd/Client/Program.cs b/test/netstd/Client/Program.cs
index 8dbff1a..47dabd3 100644
--- a/test/netstd/Client/Program.cs
+++ b/test/netstd/Client/Program.cs
@@ -34,17 +34,9 @@ namespace Client
Console.WriteLine("Failed to grow scroll-back buffer");
}
- // split mode and options
- var subArgs = new List<string>(args);
- var firstArg = string.Empty;
- if (subArgs.Count > 0)
- {
- firstArg = subArgs[0];
- subArgs.RemoveAt(0);
- }
-
- // run whatever mode is choosen
- switch(firstArg)
+ // run whatever mode is choosen, default to test impl
+ var firstArg = args.Length > 0 ? args[0] : string.Empty;
+ switch (firstArg)
{
case "client":
Console.WriteLine("The 'client' argument is no longer required.");
@@ -56,7 +48,7 @@ namespace Client
PrintHelp();
return 0;
default:
- return TestClient.Execute(subArgs);
+ return TestClient.Execute(new List<string>(args));
}
}
diff --git a/test/netstd/Server/Program.cs b/test/netstd/Server/Program.cs
index 4525ab7..1b8ffd4 100644
--- a/test/netstd/Server/Program.cs
+++ b/test/netstd/Server/Program.cs
@@ -34,17 +34,9 @@ namespace Server
Console.WriteLine("Failed to grow scroll-back buffer");
}
- // split mode and options
- var subArgs = new List<string>(args);
- var firstArg = string.Empty;
- if (subArgs.Count > 0)
- {
- firstArg = subArgs[0];
- subArgs.RemoveAt(0);
- }
-
- // run whatever mode is choosen
- switch(firstArg)
+ // run whatever mode is choosen, default to test impl
+ var firstArg = args.Length > 0 ? args[0] : string.Empty;
+ switch (firstArg)
{
case "server":
Console.WriteLine("The 'server' argument is no longer required.");
@@ -54,7 +46,7 @@ namespace Server
PrintHelp();
return 0;
default:
- return TestServer.Execute(subArgs);
+ return TestServer.Execute(new List<string>( args));
}
}