From 85f09d5da4d1c44795b5f39d3741c580792a7717 Mon Sep 17 00:00:00 2001 From: Scrub <72096833+ScrubN@users.noreply.github.com> Date: Thu, 3 Aug 2023 03:10:33 -0400 Subject: [PATCH] Use CommandLine types instead of FileVersionInfo (#779) --- TwitchDownloaderCLI/Program.cs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/TwitchDownloaderCLI/Program.cs b/TwitchDownloaderCLI/Program.cs index e5d277cb..20a96813 100644 --- a/TwitchDownloaderCLI/Program.cs +++ b/TwitchDownloaderCLI/Program.cs @@ -1,7 +1,6 @@ using CommandLine; using System; using System.Collections.Generic; -using System.Diagnostics; using System.IO; using System.Linq; using System.Runtime.InteropServices; @@ -68,7 +67,7 @@ private static void WriteHelpText(IEnumerable errors, ParserResult { builder.MaximumDisplayWidth = parserSettings.MaximumDisplayWidth; - builder.Copyright = GetManifestInfo().LegalCopyright!.Replace("\u00A9", "(c)"); + builder.Copyright = CopyrightInfo.Default.ToString()!.Replace("\u00A9", "(c)"); return builder; })); } @@ -83,14 +82,7 @@ private static void WriteApplicationBanner(ITwitchDownloaderArgs args, string[] return; } - var manifestInfo = GetManifestInfo(); - Console.WriteLine($"{manifestInfo.ProductName} v{manifestInfo.ProductVersion} {manifestInfo.LegalCopyright!.Replace("\u00A9", "(c)")}"); - } - - private static FileVersionInfo GetManifestInfo() - { - var assemblyFileName = Path.GetFileName(Environment.ProcessPath)!; - return FileVersionInfo.GetVersionInfo(assemblyFileName); + Console.WriteLine($"{HeadingInfo.Default} {CopyrightInfo.Default.ToString()!.Replace("\u00A9", "(c)")}"); } } } \ No newline at end of file