diff --git a/lib/delphi/test/TestClient.pas b/lib/delphi/test/TestClient.pas
index ff59982..6c962ab 100644
--- a/lib/delphi/test/TestClient.pas
+++ b/lib/delphi/test/TestClient.pas
@@ -150,7 +150,7 @@
     class procedure PrintCmdLineHelp;
     class procedure InvalidArgs;
   public
-    class function Execute( const args: array of string) : Byte;
+    class function Execute( const arguments: array of string) : Byte;
   end;
 
 
@@ -191,19 +191,17 @@
 const HELPTEXT = ' [options]'#10
                + #10
                + 'Allowed options:'#10
-               + '  -h [ --help ]               produce help message'#10
-               + '  --host arg (=localhost)     Host to connect'#10
-               + '  --port arg (=9090)          Port number to connect'#10
-               + '  --domain-socket arg         Domain Socket (e.g. /tmp/ThriftTest.thrift),'#10
-               + '                              instead of host and port'#10
-               + '  --pipe arg                  Windows Named Pipe (e.g. MyThriftPipe)'#10
-               + '  --anon-pipes hRead hWrite   Windows Anonymous Pipes pair (handles)'#10
-               + '  --transport arg (=sockets)  Transport: buffered, framed, http, winhttp'#10
-               + '  --protocol arg (=binary)    Protocol: binary, compact, json'#10
-               + '  --ssl                       Encrypted Transport using SSL'#10
-               + '  -n [ --testloops ] arg (=1) Number of Tests'#10
-               + '  -t [ --threads ] arg (=1)   Number of Test threads'#10
-               + '  --performance               Run the built-in performance test (no other arguments)'#10
+               + '  -h | --help                   Produces this help message'#10
+               + '  --host=arg (localhost)        Host to connect'#10
+               + '  --port=arg (9090)             Port number to connect'#10
+               + '  --pipe=arg                    Windows Named Pipe (e.g. MyThriftPipe)'#10
+               + '  --anon-pipes hRead hWrite     Windows Anonymous Pipes pair (handles)'#10
+               + '  --transport=arg (sockets)     Transport: buffered, framed, http, winhttp'#10
+               + '  --protocol=arg (binary)       Protocol: binary, compact, json'#10
+               + '  --ssl                         Encrypted Transport using SSL'#10
+               + '  -n=num | --testloops=num (1)  Number of Tests'#10
+               + '  -t=num | --threads=num (1)    Number of Test threads'#10
+               + '  --performance                 Run the built-in performance test (no other arguments)'#10
                ;
 begin
   Writeln( ChangeFileExt(ExtractFileName(ParamStr(0)),'') + HELPTEXT);
@@ -216,11 +214,22 @@
   Abort;
 end;
 
-class function TTestClient.Execute(const args: array of string) : Byte;
+class function TTestClient.Execute(const arguments: array of string) : Byte;
+
+  function IsSwitch( const aArgument, aSwitch : string; out sValue : string) : Boolean;
+  begin
+    sValue := '';
+    result := (Copy( aArgument, 1, Length(aSwitch)) = aSwitch);
+    if result then begin
+      if (Copy( aArgument, 1, Length(aSwitch)+1) = (aSwitch+'='))
+      then sValue := Copy( aArgument, Length(aSwitch)+2, MAXINT);
+    end;
+  end;
+
 var
-  i : Integer;
+  iArg : Integer;
   threadExitCode : Byte;
-  s : string;
+  sArg, sValue : string;
   threads : array of TThread;
   dtStart : TDateTime;
   test : Integer;
@@ -241,92 +250,83 @@
   end;
 
   try
-    i := 0;
-    while ( i < Length(args) ) do begin
-      s := args[i];
-      Inc( i);
+    iArg := 0;
+    while iArg < Length(arguments) do begin
+      sArg := arguments[iArg];
+      Inc(iArg);
 
-      if (s = '-h') or (s = '--help') then begin
+      if IsSwitch( sArg, '-h', sValue)
+      or IsSwitch( sArg, '--help', sValue)
+      then begin
         // -h [ --help ]               produce help message
         PrintCmdLineHelp;
         result := $FF;   // all tests failed
         Exit;
       end
-      else if s = '--host' then begin
+      else if IsSwitch( sArg, '--host', sValue) then begin
         // --host arg (=localhost)     Host to connect
-        setup.host := args[i];
-        Inc( i);
+        setup.host := sValue;
       end
-      else if s = '--port' then begin
+      else if IsSwitch( sArg, '--port', sValue) then begin
         // --port arg (=9090)          Port number to connect
-        s := args[i];
-        Inc( i);
-        setup.port := StrToIntDef(s,0);
+        setup.port := StrToIntDef(sValue,0);
         if setup.port <= 0 then InvalidArgs;
       end
-      else if s = '--domain-socket' then begin
+      else if IsSwitch( sArg, '--domain-socket', sValue) then begin
         // --domain-socket arg         Domain Socket (e.g. /tmp/ThriftTest.thrift), instead of host and port
         raise Exception.Create('domain-socket not supported');
       end
-      else if s = '--pipe' then begin
+        // --pipe arg                 Windows Named Pipe (e.g. MyThriftPipe)
+      else if IsSwitch( sArg, '--pipe', sValue) then begin
         // --pipe arg                 Windows Named Pipe (e.g. MyThriftPipe)
         setup.endpoint := trns_NamedPipes;
-        setup.sPipeName := args[i];
-        Inc( i);
+        setup.sPipeName := sValue;
         Console.WriteLine('Using named pipe ('+setup.sPipeName+')');
       end
-      else if s = '--anon-pipes' then begin
+      else if IsSwitch( sArg, '--anon-pipes', sValue) then begin
         // --anon-pipes hRead hWrite   Windows Anonymous Pipes pair (handles)
         setup.endpoint := trns_AnonPipes;
-        setup.hAnonRead := THandle( StrToIntDef( args[i], Integer(INVALID_HANDLE_VALUE)));
-        Inc( i);
-        setup.hAnonWrite := THandle( StrToIntDef( args[i], Integer(INVALID_HANDLE_VALUE)));
-        Inc( i);
+        setup.hAnonRead := THandle( StrToIntDef( arguments[iArg], Integer(INVALID_HANDLE_VALUE)));
+        Inc(iArg);
+        setup.hAnonWrite := THandle( StrToIntDef( arguments[iArg], Integer(INVALID_HANDLE_VALUE)));
+        Inc(iArg);
         Console.WriteLine('Using anonymous pipes ('+IntToStr(Integer(setup.hAnonRead))+' and '+IntToStr(Integer(setup.hAnonWrite))+')');
       end
-      else if s = '--transport' then begin
+      else if IsSwitch( sArg, '--transport', sValue) then begin
         // --transport arg (=sockets)  Transport: buffered, framed, http, winhttp, evhttp
-        s := args[i];
-        Inc( i);
-
-        if      s = 'buffered' then Include( setup.layered, trns_Buffered)
-        else if s = 'framed'   then Include( setup.layered, trns_Framed)
-        else if s = 'http'     then setup.endpoint := trns_MsXmlHttp
-        else if s = 'winhttp'  then setup.endpoint := trns_WinHttp
-        else if s = 'evhttp'   then setup.endpoint := trns_EvHttp  // recognized, but not supported
+        if      sValue = 'buffered' then Include( setup.layered, trns_Buffered)
+        else if sValue = 'framed'   then Include( setup.layered, trns_Framed)
+        else if sValue = 'http'     then setup.endpoint := trns_MsXmlHttp
+        else if sValue = 'winhttp'  then setup.endpoint := trns_WinHttp
+        else if sValue = 'evhttp'   then setup.endpoint := trns_EvHttp  // recognized, but not supported
         else InvalidArgs;
       end
-      else if s = '--protocol' then begin
+      else if IsSwitch( sArg, '--protocol', sValue) then begin
         // --protocol arg (=binary)    Protocol: binary, compact, json
-        s := args[i];
-        Inc( i);
-
-        if      s = 'binary'   then setup.protType := prot_Binary
-        else if s = 'compact'  then setup.protType := prot_Compact
-        else if s = 'json'     then setup.protType := prot_JSON
+        if      sValue = 'binary'   then setup.protType := prot_Binary
+        else if sValue = 'compact'  then setup.protType := prot_Compact
+        else if sValue = 'json'     then setup.protType := prot_JSON
         else InvalidArgs;
       end
-      else if s = '--ssl' then begin
+      else if IsSwitch( sArg, '--ssl', sValue) then begin
         // --ssl                       Encrypted Transport using SSL
         setup.useSSL := TRUE;
 
       end
-      else if (s = '-n') or (s = '--testloops') then begin
+      else if IsSwitch( sArg, '-n', sValue) or IsSwitch( sArg, '--testloops', sValue) then begin
         // -n [ --testloops ] arg (=1) Number of Tests
-        FNumIteration := StrToIntDef( args[i], 0);
-        Inc( i);
+        FNumIteration := StrToIntDef( sValue, 0);
         if FNumIteration <= 0
         then InvalidArgs;
 
       end
-      else if (s = '-t') or (s = '--threads') then begin
+      else if IsSwitch( sArg, '-t', sValue) or IsSwitch( sArg, '--threads', sValue) then begin
         // -t [ --threads ] arg (=1)   Number of Test threads
-        FNumThread := StrToIntDef( args[i], 0);
-        Inc( i);
+        FNumThread := StrToIntDef( sValue, 0);
         if FNumThread <= 0
         then InvalidArgs;
       end
-      else if (s = '--performance') then begin
+      else if IsSwitch( sArg, '--performance', sValue) then begin
         result := TPerformanceTests.Execute;
         Exit;
       end
diff --git a/lib/delphi/test/TestServer.pas b/lib/delphi/test/TestServer.pas
index f93c846..c9b374d 100644
--- a/lib/delphi/test/TestServer.pas
+++ b/lib/delphi/test/TestServer.pas
@@ -56,9 +56,9 @@
       end;
 
       TTestHandlerImpl = class( TInterfacedObject, ITestHandler )
-      private
+      strict private
         FServer : IServer;
-      protected
+      strict protected
         procedure testVoid();
         function testBool(thing: Boolean): Boolean;
         function testString(const thing: string): string;
@@ -88,9 +88,10 @@
 
       class procedure PrintCmdLineHelp;
       class procedure InvalidArgs;
+      class function  IsSwitch( const aArgument, aSwitch : string; out sValue : string) : Boolean;
 
       class procedure LaunchAnonPipeChild( const app : string; const transport : IAnonymousPipeServerTransport);
-      class procedure Execute( const args: array of string);
+      class procedure Execute( const arguments : array of string);
   end;
 
 implementation
@@ -385,18 +386,16 @@
 const HELPTEXT = ' [options]'#10
                + #10
                + 'Allowed options:'#10
-               + '  -h [ --help ]               produce help message'#10
-               + '  --port arg (=9090)          Port number to listen'#10
-               + '  --domain-socket arg         Unix Domain Socket (e.g. /tmp/ThriftTest.thrift)'#10
-               + '  --pipe arg                  Windows Named Pipe (e.g. MyThriftPipe)'#10
-               + '  --server-type arg (=simple) type of server, "simple", "thread-pool",'#10
-               + '                              "threaded", or "nonblocking"'#10
-               + '  --transport arg (=socket)   transport: buffered, framed, http, anonpipe'#10
-               + '  --protocol arg (=binary)    protocol: binary, compact, json'#10
-               + '  --ssl                       Encrypted Transport using SSL'#10
-               + '  --processor-events          processor-events'#10
-               + '  -n [ --workers ] arg (=4)   Number of thread pools workers. Only valid for'#10
-               + '                              thread-pool server type'#10
+               + '  -h | --help                   Produces this help message'#10
+               + '  --port=arg (9090)             Port number to connect'#10
+               + '  --pipe=arg                    Windows Named Pipe (e.g. MyThriftPipe)'#10
+               + '  --anon-pipes                  Windows Anonymous Pipes server, auto-starts client.exe'#10
+               + '  --server-type=arg (simple)    Type of server (simple, thread-pool, threaded, nonblocking)'#10
+               + '  --transport=arg (sockets)     Transport: buffered, framed, anonpipe'#10
+               + '  --protocol=arg (binary)       Protocol: binary, compact, json'#10
+               + '  --ssl                         Encrypted Transport using SSL'#10
+               + '  --processor-events            Enable processor-events'#10
+               + '  -n=num | --workers=num (4)    Number of thread-pool server workers'#10
                ;
 begin
   Console.WriteLine( ChangeFileExt(ExtractFileName(ParamStr(0)),'') + HELPTEXT);
@@ -409,6 +408,16 @@
   Abort;
 end;
 
+class function TTestServer.IsSwitch( const aArgument, aSwitch : string; out sValue : string) : Boolean;
+begin
+  sValue := '';
+  result := (Copy( aArgument, 1, Length(aSwitch)) = aSwitch);
+  if result then begin
+    if (Copy( aArgument, 1, Length(aSwitch)+1) = (aSwitch+'='))
+    then sValue := Copy( aArgument, Length(aSwitch)+2, MAXINT);
+  end;
+end;
+
 class procedure TTestServer.LaunchAnonPipeChild( const app : string; const transport : IAnonymousPipeServerTransport);
 //Launch child process and pass R/W anonymous pipe handles on cmd line.
 //This is a simple example and does not include elevation or other
@@ -431,7 +440,7 @@
     sArg := ParamStr(i);
 
     // add anonymous handles and quote strings where appropriate
-    if sArg = '-anon'
+    if sArg = '--anon-pipes'
     then sArg := sArg +' '+ sHandles
     else begin
       if Pos(' ',sArg) > 0
@@ -446,11 +455,11 @@
   Win32Check( CreateProcess( nil, PChar(sCmdLine), nil,nil,TRUE,0,nil,nil,si,pi));
 
   CloseHandle( pi.hThread);
-    CloseHandle( pi.hProcess);
+  CloseHandle( pi.hProcess);
 end;
 
 
-class procedure TTestServer.Execute( const args: array of string);
+class procedure TTestServer.Execute( const arguments : array of string);
 var
   Port : Integer;
   ServerEvents : Boolean;
@@ -463,8 +472,8 @@
   namedpipe : INamedPipeServerTransport;
   TransportFactory : ITransportFactory;
   ProtocolFactory : IProtocolFactory;
-  i, numWorker : Integer;
-  s : string;
+  iArg, numWorker : Integer;
+  sArg, sValue : string;
   protType : TKnownProtocol;
   servertype : TServerType;
   endpoint : TEndpointTransport;
@@ -482,83 +491,68 @@
     sPipeName := '';
     numWorker := 4;
 
-    i := 0;
-    while ( i < Length(args) ) do begin
-      s := args[i];
-      Inc(i);
+    iArg := 0;
+    while iArg < Length(arguments) do begin
+      sArg := arguments[iArg];
+      Inc(iArg);
 
       // Allowed options:
-      if (s = '-h') or (s = '--help') then begin
-        // -h [ --help ]               produce help message
+      if IsSwitch( sArg, '-h', sValue)
+      or IsSwitch( sArg, '--help', sValue)
+      then begin
+        // -h | --help               produce help message
         PrintCmdLineHelp;
         Exit;
       end
-      else if (s = '--port') then begin
+      else if IsSwitch( sArg, '--port', sValue) then begin
         // --port arg (=9090)          Port number to listen
-        s := args[i];
-        Inc(i);
-        Port := StrToIntDef( s, Port);
+        Port := StrToIntDef( sValue, Port);
       end
-      else if (s = '--domain-socket') then begin
-        // --domain-socket arg         Unix Domain Socket (e.g. /tmp/ThriftTest.thrift)
-        raise Exception.Create('domain-socket not supported');
+      else if IsSwitch( sArg, '--anon-pipes', sValue) then begin
+        endpoint := trns_AnonPipes;
       end
-      else if (s = '--pipe') then begin
+      else if IsSwitch( sArg, '--pipe', sValue) then begin
         // --pipe arg                   Windows Named Pipe (e.g. MyThriftPipe)
         endpoint := trns_NamedPipes;
-        sPipeName := args[i];  // --pipe <name>
-        Inc( i );
+        sPipeName := sValue;  // --pipe <name>
       end
-      else if (s = '--server-type') then begin
+      else if IsSwitch( sArg, '--server-type', sValue) then begin
         // --server-type arg (=simple) type of server,
         // arg = "simple", "thread-pool", "threaded", or "nonblocking"
-        s := args[i];
-        Inc(i);
-
-        if      s = 'simple'      then servertype := srv_Simple
-        else if s = 'thread-pool' then servertype := srv_Threadpool
-        else if s = 'threaded'    then servertype := srv_Threaded
-        else if s = 'nonblocking' then servertype := srv_Nonblocking
+        if      sValue = 'simple'      then servertype := srv_Simple
+        else if sValue = 'thread-pool' then servertype := srv_Threadpool
+        else if sValue = 'threaded'    then servertype := srv_Threaded
+        else if sValue = 'nonblocking' then servertype := srv_Nonblocking
         else InvalidArgs;
       end
-      else if (s = '--transport') then begin
+      else if IsSwitch( sArg, '--transport', sValue) then begin
         // --transport arg (=buffered) transport: buffered, framed, http
-        s := args[i];
-        Inc(i);
-
-        if      s = 'buffered' then Include( layered, trns_Buffered)
-        else if s = 'framed'   then Include( layered, trns_Framed)
-        else if s = 'http'     then endpoint := trns_MsxmlHttp
-        else if s = 'winhttp'  then endpoint := trns_WinHttp
-        else if s = 'anonpipe' then endpoint := trns_AnonPipes
+        if      sValue = 'buffered' then Include( layered, trns_Buffered)
+        else if sValue = 'framed'   then Include( layered, trns_Framed)
+        else if sValue = 'http'     then endpoint := trns_MsxmlHttp
+        else if sValue = 'winhttp'  then endpoint := trns_WinHttp
+        else if sValue = 'anonpipe' then endpoint := trns_AnonPipes
         else InvalidArgs;
       end
-      else if (s = '--protocol') then begin
+      else if IsSwitch( sArg, '--protocol', sValue) then begin
         // --protocol arg (=binary)    protocol: binary, compact, json
-        s := args[i];
-        Inc(i);
-
-        if      s = 'binary'   then protType := prot_Binary
-        else if s = 'compact'  then protType := prot_Compact
-        else if s = 'json'     then protType := prot_JSON
+        if      sValue = 'binary'   then protType := prot_Binary
+        else if sValue = 'compact'  then protType := prot_Compact
+        else if sValue = 'json'     then protType := prot_JSON
         else InvalidArgs;
       end
-      else if (s = '--ssl') then begin
+      else if IsSwitch( sArg, '--ssl', sValue) then begin
         // --ssl     Encrypted Transport using SSL
         UseSSL := TRUE;
       end
-      else if (s = '--processor-events') then begin
+      else if IsSwitch( sArg, '--processor-events', sValue) then begin
          // --processor-events          processor-events
         ServerEvents := TRUE;
       end
-      else if (s = '-n') or (s = '--workers') then begin
+      else if IsSwitch( sArg, '-n', sValue) or IsSwitch( sArg, '--workers', sValue) then begin
         // -n [ --workers ] arg (=4)   Number of thread pools workers.
         // Only valid for thread-pool server type
-        s := args[i];
-        numWorker := StrToIntDef(s,0);
-        if numWorker > 0
-        then Inc(i)
-        else numWorker := 4;
+        numWorker := StrToIntDef(sValue,4);
       end
       else begin
         InvalidArgs;
