Changeset 14967 for lang/csharp

Show
Ignore:
Timestamp:
07/01/08 03:18:10 (5 months ago)
Author:
mayuki
Message:

ちょこっと修正とテストっぽい物を追加。

Location:
lang/csharp/CommandLineParser
Files:
6 added
2 modified

Legend:

Unmodified
Added
Removed
  • lang/csharp/CommandLineParser/CommandLineParser.sln

    r5071 r14967  
    66Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample", "Sample\Sample.csproj", "{6D08D680-D1F4-4FF3-8598-5EACEFCB6B71}" 
    77EndProject 
     8Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommandLineParserTest", "CommandLineParserTest\CommandLineParserTest.csproj", "{1138FFD8-09C8-4F6E-92F1-E35AC8AB04AC}" 
     9EndProject 
     10Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{646A3556-EC2F-4816-BAAC-56FA3CD80A79}" 
     11        ProjectSection(SolutionItems) = preProject 
     12                CommandLineParser.vsmdi = CommandLineParser.vsmdi 
     13                LocalTestRun.testrunconfig = LocalTestRun.testrunconfig 
     14        EndProjectSection 
     15EndProject 
    816Global 
     17        GlobalSection(TestCaseManagementSettings) = postSolution 
     18                CategoryFile = CommandLineParser.vsmdi 
     19        EndGlobalSection 
    920        GlobalSection(SolutionConfigurationPlatforms) = preSolution 
    1021                Debug|Any CPU = Debug|Any CPU 
     
    2031                {6D08D680-D1F4-4FF3-8598-5EACEFCB6B71}.Release|Any CPU.ActiveCfg = Release|Any CPU 
    2132                {6D08D680-D1F4-4FF3-8598-5EACEFCB6B71}.Release|Any CPU.Build.0 = Release|Any CPU 
     33                {1138FFD8-09C8-4F6E-92F1-E35AC8AB04AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 
     34                {1138FFD8-09C8-4F6E-92F1-E35AC8AB04AC}.Debug|Any CPU.Build.0 = Debug|Any CPU 
     35                {1138FFD8-09C8-4F6E-92F1-E35AC8AB04AC}.Release|Any CPU.ActiveCfg = Release|Any CPU 
     36                {1138FFD8-09C8-4F6E-92F1-E35AC8AB04AC}.Release|Any CPU.Build.0 = Release|Any CPU 
    2237        EndGlobalSection 
    2338        GlobalSection(SolutionProperties) = preSolution 
  • lang/csharp/CommandLineParser/CommandLineParser/CommandLineParser.cs

    r14964 r14967  
    169169                 
    170170                String[] parts = args[i].Split(ValueParamDelimiter, 2); 
    171                 String memberName = (DelimiterizeAndToLowerCase ? ToUpperCamelCase(parts[0]) : parts[0].Substring(Prefix.Length)); 
     171                parts[0] = parts[0].Substring(Prefix.Length); 
     172                String memberName = (DelimiterizeAndToLowerCase ? ToUpperCamelCase(parts[0]) : parts[0]); 
    172173 
    173174                // Help 
     
    175176                    return default(T); 
    176177                 
    177                 if (!_availableOptions.ContainsKey(memberName)) 
     178                if (!_availableOptions.ContainsKey(memberName) && !_availableOptions.ContainsKey(parts[0])) 
    178179                { 
    179180                    //Debug.WriteLine(String.Format("Unknown option '{0}'", parts[0])); 
     
    182183                } 
    183184 
    184                 PropertyInfo optionProperty = _availableOptions[memberName]; 
     185                PropertyInfo optionProperty = _availableOptions[_availableOptions.ContainsKey(memberName) ? memberName : parts[0]]; 
    185186                if (parts.Length == 1) 
    186187                {