Skip to content

Commit

Permalink
CLUNL.ConsoleAppHelper 0.0.7.0
Browse files Browse the repository at this point in the history
Fixed a crash in PrintHelp() when assembly file is not available.
  • Loading branch information
creeperlv committed Aug 9, 2022
1 parent d648ab8 commit 0abf87f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CLUNL.ConsoleAppHelper/CLUNL.ConsoleAppHelper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<Version>0.0.6.0</Version>
<Version>0.0.7.0</Version>
<PackageLicenseExpression></PackageLicenseExpression>
<PackageProjectUrl>https://github.com/creeperlv/CLUNL</PackageProjectUrl>
<RepositoryUrl>https://github.com/creeperlv/CLUNL</RepositoryUrl>
Expand Down
6 changes: 6 additions & 0 deletions CLUNL.ConsoleAppHelper/ConsoleAppHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,10 @@ public static void Init(string FeatureCollectionID, string ProductName = "CLUNL"
/// </summary>
public static string LanguageConfigurationFile = null;
/// <summary>
/// Override the default executable name by setting it to non-null value to avoid some crashing related to reflection.
/// </summary>
public static string ExecutableName = null;
/// <summary>
/// Print out a auto-generated help document.
/// </summary>
public static void PrintHelp()
Expand Down Expand Up @@ -336,7 +340,9 @@ public static void PrintHelp()
var option = Language.Find("General.Console.Option", "Option");
var MainParameter = Language.Find("General.Console.MainParameter", "Main Parameter");
OutLine();
if(ExecutableName==null)
OutLine($"\t{new FileInfo(Assembly.GetEntryAssembly().Location).Name} (exe) <{command}> [{option}] [...] [{MainParameter}]");
else OutLine($"\t{ExecutableName} (exe) <{command}> [{option}] [...] [{MainParameter}]");
OutLine();
OutLine(Language.Find("General.Console.Commands", "Commands:"));
OutLine();
Expand Down

0 comments on commit 0abf87f

Please sign in to comment.