Skip to content

Commit

Permalink
Use CommandLine types instead of FileVersionInfo (#779)
Browse files Browse the repository at this point in the history
  • Loading branch information
ScrubN authored Aug 3, 2023
1 parent ea53fac commit 85f09d5
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions TwitchDownloaderCLI/Program.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -68,7 +67,7 @@ private static void WriteHelpText(IEnumerable<Error> errors, ParserResult<object
HelpText.AutoBuild(parserResult, builder =>
{
builder.MaximumDisplayWidth = parserSettings.MaximumDisplayWidth;
builder.Copyright = GetManifestInfo().LegalCopyright!.Replace("\u00A9", "(c)");
builder.Copyright = CopyrightInfo.Default.ToString()!.Replace("\u00A9", "(c)");
return builder;
}));
}
Expand All @@ -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)")}");
}
}
}

0 comments on commit 85f09d5

Please sign in to comment.