@@ -19,7 +19,7 @@ namespace MatthiWare.CommandLine
1919 public sealed class CommandLineParser < TSource > : ICommandLineParser < TSource > where TSource : class , new ( )
2020 {
2121 private readonly TSource m_option ;
22- private readonly List < CommandLineArgumentOptionBase > m_options ;
22+ private readonly List < CommandLineOptionBase > m_options ;
2323 private readonly List < CommandLineCommandBase > m_commands ;
2424
2525 public IReadOnlyList < ICommandLineOption > Options => m_options . AsReadOnly ( ) ;
@@ -32,7 +32,7 @@ public CommandLineParser()
3232 {
3333 m_option = new TSource ( ) ;
3434
35- m_options = new List < CommandLineArgumentOptionBase > ( ) ;
35+ m_options = new List < CommandLineOptionBase > ( ) ;
3636 m_commands = new List < CommandLineCommandBase > ( ) ;
3737
3838 ResolverFactory = new ResolverFactory ( ) ;
@@ -43,7 +43,7 @@ public IOptionBuilder<TProperty> Configure<TProperty>(Expression<Func<TSource, T
4343
4444 private IOptionBuilder < TProperty > ConfigureInternal < TProperty > ( Expression < Func < TSource , TProperty > > selector )
4545 {
46- var option = new CommandLineArgumentOption < TSource , TProperty > ( m_option , selector , ResolverFactory . CreateResolver < TProperty > ( ) ) ;
46+ var option = new CommandLineOption < TSource , TProperty > ( m_option , selector , ResolverFactory . CreateResolver < TProperty > ( ) ) ;
4747
4848 m_options . Add ( option ) ;
4949
@@ -59,9 +59,7 @@ public IParserResult<TSource> Parse(string[] args)
5959
6060 foreach ( var cmd in m_commands )
6161 {
62- int idx = lstArgs . FindIndex ( arg =>
63- ( cmd . HasShortName && string . Equals ( cmd . ShortName , arg , StringComparison . InvariantCultureIgnoreCase ) ) ||
64- ( cmd . HasLongName && string . Equals ( cmd . LongName , arg , StringComparison . InvariantCultureIgnoreCase ) ) ) ;
62+
6563
6664 if ( idx < 0 || idx > lstArgs . Count )
6765 {
@@ -81,9 +79,7 @@ public IParserResult<TSource> Parse(string[] args)
8179
8280 foreach ( var option in m_options )
8381 {
84- int idx = lstArgs . FindIndex ( arg =>
85- ( option . HasShortName && string . Equals ( option . ShortName , arg , StringComparison . InvariantCultureIgnoreCase ) ) ||
86- ( option . HasLongName && string . Equals ( option . LongName , arg , StringComparison . InvariantCultureIgnoreCase ) ) ) ;
82+
8783
8884 if ( idx < 0 || idx > lstArgs . Count )
8985 {
0 commit comments