Skip to content

Commit

Permalink
Upgrade System.CommandLine to latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirwin committed Aug 20, 2023
1 parent dce8dc9 commit d1b30d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Colibri/Colibri.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.21308.1" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
</ItemGroup>

<ItemGroup>
Expand Down
9 changes: 4 additions & 5 deletions Colibri/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.CommandLine;
using System.CommandLine.Invocation;
using System.Reflection;
using Antlr4.Runtime;
using Colibri.Core;
Expand All @@ -10,12 +9,14 @@ public class Program
{
public static int Main(string[] args)
{
var fileOption = new Option<FileInfo>("--file", "A Colibri Lisp file to execute.");

var rootCommand = new RootCommand("A modern Lisp-based language in .NET.")
{
new Option<FileInfo>("--file", "A Colibri Lisp file to execute."),
fileOption,
};

rootCommand.Handler = CommandHandler.Create<FileInfo?>(FileHandler);
rootCommand.SetHandler(FileHandler, fileOption);

return rootCommand.Invoke(args);
}
Expand Down Expand Up @@ -157,8 +158,6 @@ private static void PrintException(Exception ex)
private static void PrintSystemInfo()
{
Console.WriteLine($"Colibri Lisp v{typeof(Program).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion ?? "Unknown"}");

Console.WriteLine($".NET {Environment.Version}, {Environment.OSVersion}");

Console.WriteLine();
}
Expand Down

0 comments on commit d1b30d2

Please sign in to comment.