Skip to content

Commit 76f0e01

Browse files
committed
Add version parameter
1 parent 0510879 commit 76f0e01

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Program.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@ static void Main(string[] args)
66
{
77
Version? version = typeof(Program).Assembly.GetName().Version;
88

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

0 commit comments

Comments
 (0)