src/ArgumentParser.cs
/// <summary>
/// Parses passed in arguments and fills all properties with the <see cref="CommandArgumentAttribute"/> Attribute.
/// </summary>
/// <param name="args">passed in arguments.</param>
/// <param name="command"></param>
/// <returns>remaining arguments which were not filled in properties.</returns>
Parses passed in arguments and fills all properties with the  Attribute.
Parses passed in arguments and fills all properties with the Attribute .
private IEnumerable<string> FillAllArguments(IEnumerable<string> args, Command command)
        {
            var arguments = Command.GetArgumentProperties(command.GetType());
            if (!arguments.Any())
            {
                if (IsOption(args.FirstOrDefault(), command))
                {
                    return args;
                }
                throw new NoArgumentsExistException();
            }
            var counter = 0;
            foreach (var value in args)
            {
                if (IsOption(value, command))
                {
                    break;
                }
                var argument = arguments.ElementAt(counter);
                argument.Key.SetValue(command, argument.Value, value);
                counter++;
            }
            var nextRequiredArgument = command.GetRequiredArguments().Skip(counter).FirstOrDefault();
            if (nextRequiredArgument != null)
            {
                throw new RequiredArgumentException(nextRequiredArgument.Attribute.Name);
            }
            return args.Skip(counter);
        }
private IEnumerable < string > FillAllArguments ( IEnumerable < string > args , Command command ) { var arguments = Command . GetArgumentProperties ( command . GetType ( ) ) ; if ( ! arguments . Any ( ) ) { if ( IsOption ( args . FirstOrDefault ( ) , command ) ) { return args ; } throw new NoArgumentsExistException ( ) ; } var counter = 0 ; foreach ( var value in args ) { if ( IsOption ( value , command ) ) { break ; } var argument = arguments . ElementAt ( counter ) ; argument . Key . SetValue ( command , argument . Value , value ) ; counter ++ ; } var nextRequiredArgument = command . GetRequiredArguments ( ) . Skip ( counter ) . FirstOrDefault ( ) ; if ( nextRequiredArgument != null ) { throw new RequiredArgumentException ( nextRequiredArgument . Attribute . Name ) ; } return args . Skip ( counter ) ; }
Parses passed in arguments and fills all properties with the  Attribute.
Parses passed in arguments and fills all properties with the Attribute .
remaining arguments which were not filled in properties.
remaining arguments which were not filled in properties .
args
IEnumerable<string>
passed in arguments.
passed in arguments .
command
Command
None