GH-242: Fix version retrieval for single file applications (#245)

This commit is contained in:
Milosz Krajewski
2021-01-25 23:45:38 +00:00
committed by GitHub
parent 31a5e17a45
commit ad49b6aa67
7 changed files with 53 additions and 17 deletions

View File

@ -25,6 +25,23 @@ namespace Spectre.Console.Cli
return configurator;
}
/// <summary>
/// Overrides the auto-detected version of the application.
/// </summary>
/// <param name="configurator">The configurator.</param>
/// <param name="version">The version of application.</param>
/// <returns>A configurator that can be used to configure the application further.</returns>
public static IConfigurator SetApplicationVersion(this IConfigurator configurator, string version)
{
if (configurator == null)
{
throw new ArgumentNullException(nameof(configurator));
}
configurator.Settings.ApplicationVersion = version;
return configurator;
}
/// <summary>
/// Configures the console.
/// </summary>