diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Program.cs | 16 | ||||
| -rw-r--r-- | src/slskd/State.cs | 3 |
2 files changed, 12 insertions, 7 deletions
diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs index e4257037..79c012bb 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -92,7 +92,12 @@ namespace slskd /// <summary> /// Gets the full application version, including both assembly and informational versions. /// </summary> - public static readonly string Version = $"{AssemblyVersion} ({InformationalVersion})"; + public static readonly string FullVersion = $"{AssemblyVersion} ({InformationalVersion})"; + + /// <summary> + /// Gets the semantic application version. + /// </summary> + public static readonly string SemanticVersion = InformationalVersion.Split('-').First(); /// <summary> /// Gets a value indicating whether the current version is a Canary build. @@ -172,7 +177,7 @@ namespace slskd if (ShowVersion) { - Console.WriteLine(Version); + Console.WriteLine(FullVersion); return; } @@ -180,7 +185,7 @@ namespace slskd { if (!NoLogo) { - PrintLogo(Version); + PrintLogo(FullVersion); } if (ShowHelp) @@ -249,7 +254,6 @@ namespace slskd .MinimumLevel.Override("Microsoft", LogEventLevel.Warning) .MinimumLevel.Override("System.Net.Http.HttpClient", OptionsAtStartup.Debug ? LogEventLevel.Warning : LogEventLevel.Fatal) .MinimumLevel.Override("slskd.Authentication.PassthroughAuthenticationHandler", LogEventLevel.Warning) - .Enrich.WithProperty("Version", Version) .Enrich.WithProperty("InstanceName", OptionsAtStartup.InstanceName) .Enrich.WithProperty("InvocationId", InvocationId) .Enrich.WithProperty("ProcessId", ProcessId) @@ -285,10 +289,10 @@ namespace slskd if (!OptionsAtStartup.NoLogo) { - PrintLogo(Version); + PrintLogo(FullVersion); } - logger.Information("Version: {Version}", Version); + logger.Information("Version: {Version}", FullVersion); if (IsCanary) { diff --git a/src/slskd/State.cs b/src/slskd/State.cs index bff2dc5b..afe9b0b1 100644 --- a/src/slskd/State.cs +++ b/src/slskd/State.cs @@ -38,7 +38,8 @@ namespace slskd public record VersionState { - public string Current { get; init; } = Program.InformationalVersion; + public string Full { get; init; } = Program.FullVersion; + public string Current { get; init; } = Program.SemanticVersion; public string Latest { get; init; } = null; public bool? IsUpdateAvailable { get; init; } = null; public bool IsCanary { get; init; } = Program.IsCanary; |
