Display the application version (if set) when a version flag is the first argument, even if a default command has been set.

This commit is contained in:
Frank Ray 2024-10-09 10:22:38 +01:00 committed by Patrik Svensson
parent 17c7a4f7d6
commit dfdd129dd0

View File

@ -29,9 +29,6 @@ internal sealed class CommandExecutor
_registrar.RegisterInstance(typeof(CommandModel), model); _registrar.RegisterInstance(typeof(CommandModel), model);
_registrar.RegisterDependencies(model); _registrar.RegisterDependencies(model);
// No default command?
if (model.DefaultCommand == null)
{
// Got at least one argument? // Got at least one argument?
var firstArgument = arguments.FirstOrDefault(); var firstArgument = arguments.FirstOrDefault();
if (firstArgument != null) if (firstArgument != null)
@ -49,7 +46,6 @@ internal sealed class CommandExecutor
} }
} }
} }
}
// Parse and map the model against the arguments. // Parse and map the model against the arguments.
var parsedResult = ParseCommandLineArguments(model, configuration.Settings, arguments); var parsedResult = ParseCommandLineArguments(model, configuration.Settings, arguments);