diff --git a/src/Spectre.Console.Cli/ConfiguratorExtensions.cs b/src/Spectre.Console.Cli/ConfiguratorExtensions.cs index eb3f1be19..80895e302 100644 --- a/src/Spectre.Console.Cli/ConfiguratorExtensions.cs +++ b/src/Spectre.Console.Cli/ConfiguratorExtensions.cs @@ -82,7 +82,7 @@ public static IConfigurator SetApplicationName(this IConfigurator configurator, } /// - /// Overrides the auto-detected version of the application. + /// Sets the version of the application. /// /// The configurator. /// The version of application. @@ -98,6 +98,25 @@ public static IConfigurator SetApplicationVersion(this IConfigurator configurato return configurator; } + /// + /// Uses the version retrieved from the + /// as the application's version. + /// + /// The configurator. + /// A configurator that can be used to configure the application further. + public static IConfigurator UseAssemblyInformationalVersion(this IConfigurator configurator) + { + if (configurator == null) + { + throw new ArgumentNullException(nameof(configurator)); + } + + configurator.Settings.ApplicationVersion = + VersionHelper.GetVersion(Assembly.GetEntryAssembly()); + + return configurator; + } + /// /// Hides the DEFAULT column that lists default values coming from the /// in the options help text.