From 76f0e01f8f500ebe2b6d11298b6358c61bb2827a Mon Sep 17 00:00:00 2001 From: TollyH Date: Wed, 2 Aug 2023 01:55:39 +0100 Subject: [PATCH] Add version parameter --- Program.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Program.cs b/Program.cs index f7ad26f..87078bc 100644 --- a/Program.cs +++ b/Program.cs @@ -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(); } @@ -719,6 +724,7 @@ void DisplayDebugInfo() case "help": Console.WriteLine("Usage: 'AssEmbly [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");