@@ -330,7 +330,8 @@ public Arguments(string[] args)
330330
331331 if ( IsParsed )
332332 {
333- Args = ParseCmdLine ( args ) ;
333+ Dictionary < string , string > origcase = new Dictionary < string , string > ( ) ;
334+ Args = ParseCmdLine ( args , ref origcase ) ;
334335
335336 #region Plan
336337 if ( Args . Keys . Contains ( __plan ) )
@@ -497,6 +498,12 @@ public Arguments(string[] args)
497498 Verbose = false ;
498499 }
499500 #endregion
501+
502+ //this returns a colleection with original casing from the cmdline parms
503+ Dictionary < string , string > newArgs = new Dictionary < string , string > ( ) ;
504+ foreach ( string key in Args . Keys )
505+ newArgs . Add ( origcase [ key ] , Args [ key ] ) ;
506+ Args = newArgs ;
500507 }
501508
502509 IsParsed &= string . IsNullOrWhiteSpace ( Message ) ;
@@ -523,7 +530,7 @@ public Arguments(string[] args)
523530 public bool IsSample { get { return ! string . IsNullOrWhiteSpace ( Sample ) ; } }
524531 public bool Verbose { get ; internal set ; }
525532
526- Dictionary < string , string > ParseCmdLine ( string [ ] args )
533+ Dictionary < string , string > ParseCmdLine ( string [ ] args , ref Dictionary < string , string > origcase )
527534 {
528535 IsParsed = true ;
529536 Dictionary < string , string > options = new Dictionary < string , string > ( ) ;
@@ -537,8 +544,10 @@ Dictionary<string, string> ParseCmdLine(string[] args)
537544 // If match not found, command line args are improperly formed.
538545 if ( match . Success )
539546 {
540- options [ match . Groups [ "argname" ] . Value . ToLower ( ) . TrimStart ( '/' ) ] =
541- match . Groups [ "argvalue" ] . Value ;
547+ string orig = match . Groups [ "argname" ] . Value . TrimStart ( '/' ) ;
548+ string lcase = orig . ToLower ( ) ;
549+ options [ lcase ] = match . Groups [ "argvalue" ] . Value ;
550+ origcase [ lcase ] = orig ;
542551 }
543552 else
544553 {
0 commit comments