Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Dotnet.Script/Dotnet.Script.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.0-6.final" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="2.2.5" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
Expand Down
9 changes: 5 additions & 4 deletions src/Dotnet.Script/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ public static Func<string, bool, LogFactory> CreateLogFactory

private static int Wain(string[] args)
{
var app = new CommandLineApplication(throwOnUnexpectedArg: false)
var app = new CommandLineApplication()
{
UnrecognizedArgumentHandling = UnrecognizedArgumentHandling.CollectAndContinue,
ExtendedHelpText = "Starting without a path to a CSX file or a command, starts the REPL (interactive) mode."
};

Expand All @@ -83,7 +84,7 @@ private static int Wain(string[] args)
var code = c.Argument("code", "Code to execute.");
var cwd = c.Option("-cwd |--workingdirectory <currentworkingdirectory>", "Working directory for the code compiler. Defaults to current directory.", CommandOptionType.SingleValue);
c.HelpOption(helpOptionTemplate);
c.OnExecute(async () =>
c.OnExecuteAsync(async (cancellationToken) =>
{
var source = code.Value;
if (string.IsNullOrWhiteSpace(source))
Expand Down Expand Up @@ -198,7 +199,7 @@ private static int Wain(string[] args)
var dllPath = c.Argument("dll", "Path to DLL based script");
var commandDebugMode = c.Option(DebugFlagShort + " | " + DebugFlagLong, "Enables debug output.", CommandOptionType.NoValue);
c.HelpOption(helpOptionTemplate);
c.OnExecute(async () =>
c.OnExecuteAsync(async (cancellationToken) =>
{
if (string.IsNullOrWhiteSpace(dllPath.Value))
{
Expand All @@ -217,7 +218,7 @@ private static int Wain(string[] args)
});
});

app.OnExecute(async () =>
app.OnExecuteAsync(async (cancellationToken) =>
{
int exitCode = 0;

Expand Down