mirror of
				https://github.com/nsnail/spectre.console.git
				synced 2025-11-01 01:25:27 +08:00 
			
		
		
		
	 Nils Andresen
					Nils Andresen
				
			
				
					committed by
					
						 Patrik Svensson
						Patrik Svensson
					
				
			
			
				
	
			
			
			 Patrik Svensson
						Patrik Svensson
					
				
			
						parent
						
							3f561e0902
						
					
				
				
					commit
					55633b59fa
				
			| @@ -67,8 +67,12 @@ namespace Spectre.Console.Cli | ||||
|                 throw CommandConfigurationException.BranchHasNoChildren(command); | ||||
|             } | ||||
|  | ||||
|             // Multiple vector arguments? | ||||
|             var arguments = command.Parameters.OfType<CommandArgument>(); | ||||
|             var arguments = command.Parameters | ||||
|                 .OfType<CommandArgument>() | ||||
|                 .OrderBy(x => x.Position) | ||||
|                 .ToList(); | ||||
|  | ||||
|             // vector arguments? | ||||
|             if (arguments.Any(x => x.ParameterKind == ParameterKind.Vector)) | ||||
|             { | ||||
|                 // Multiple vector arguments for command? | ||||
| @@ -77,7 +81,7 @@ namespace Spectre.Console.Cli | ||||
|                     throw CommandConfigurationException.TooManyVectorArguments(command); | ||||
|                 } | ||||
|  | ||||
|                 // Make sure that vector arguments are specified last. | ||||
|                 // Make sure that the vector argument is specified last. | ||||
|                 if (arguments.Last().ParameterKind != ParameterKind.Vector) | ||||
|                 { | ||||
|                     throw CommandConfigurationException.VectorArgumentNotSpecifiedLast(command); | ||||
| @@ -85,7 +89,6 @@ namespace Spectre.Console.Cli | ||||
|             } | ||||
|  | ||||
|             // Arguments | ||||
|             var argumnets = command.Parameters.OfType<CommandArgument>(); | ||||
|             foreach (var argument in arguments) | ||||
|             { | ||||
|                 if (argument.Required && argument.DefaultValue != null) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user