Skip to content

Commit

Permalink
Add version parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
TollyH committed Aug 2, 2023
1 parent 0510879 commit 76f0e01
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@ static void Main(string[] args)
{
Version? version = typeof(Program).Assembly.GetName().Version;

if (args.Contains("--version"))
{
Console.WriteLine(version?.ToString());
return;
}
if (!args.Contains("--no-header"))
{
Console.WriteLine($"AssEmbly {version?.Major}.{version?.Minor}.{version?.Revision} - A mock assembly language running on .NET");
Console.WriteLine($"AssEmbly {version?.Major}.{version?.Minor}.{version?.Build} - A mock assembly language running on .NET");
Console.WriteLine("Copyright © 2022-2023 Ptolemy Hill");
Console.WriteLine();
}
Expand Down Expand Up @@ -719,6 +724,7 @@ void DisplayDebugInfo()
case "help":
Console.WriteLine("Usage: 'AssEmbly <operation> <required-parameters (if any)> [optional-parameters]'");
Console.WriteLine("Any command can take the '--no-header' optional parameter to disable the copyright printout.");
Console.WriteLine("Using the '--version' optional parameter will print just the current version of AssEmbly then exit, regardless of other parameters.");
Console.WriteLine();
Console.WriteLine("Operations:");
Console.WriteLine("assemble - Take a program written in AssEmbly and assemble it down to executable bytecode");
Expand Down

0 comments on commit 76f0e01

Please sign in to comment.