8000 Merge pull request #640 from badbort/mcmaster-update-3.0.0 · dotnet-script/dotnet-script@114aed0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 114aed0

Browse files
authored
Merge pull request #640 from badbort/mcmaster-update-3.0.0
Updated McMaster.Extensions.CommandLineUtils to 3.0.0
2 parents 38712a7 + 6d5f14f commit 114aed0

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/Dotnet.Script/Dotnet.Script.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
</PropertyGroup>
2626
<ItemGroup>
2727
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.0-6.final" />
28-
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="2.2.5" />
28+
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="3.0.0" />
2929
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="5.0.0" />
3030
</ItemGroup>
3131
<ItemGroup>

src/Dotnet.Script/Program.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ public static Func<string, bool, LogFactory> CreateLogFactory
5555

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

@@ -83,7 +84,7 @@ private static int Wain(string[] args)
8384
var code = c.Argument("code", "Code to execute.");
8485
var cwd = c.Option("-cwd |--workingdirectory <currentworkingdirectory>", "Working directory for the code compiler. Defaults to current directory.", CommandOptionType.SingleValue);
8586
c.HelpOption(helpOptionTemplate);
86-
c.OnExecute(async () =>
87+
c.OnExecuteAsync(async (cancellationToken) =>
8788
{
8889
var source = code.Value;
8990
if (string.IsNullOrWhiteSpace(source))
@@ -198,7 +199,7 @@ private static int Wain(string[] args)
198199
var dllPath = c.Argument("dll", "Path to DLL based script");
199200
var commandDebugMode = c.Option(DebugFlagShort + " | " + DebugFlagLong, "Enables debug output.", CommandOptionType.NoValue);
200201
c.HelpOption(helpOptionTemplate);
201-
c.OnExecute(async () =>
202+
c.OnExecuteAsync(async (cancellationToken) =>
202203
{
203204
if (string.IsNullOrWhiteSpace(dllPath.Value))
204205
{
@@ -217,7 +218,7 @@ private static int Wain(string[] args)
217218
});
218219
});
219220

220-
app.OnExecute(async () =>
221+
app.OnExecuteAsync(async (cancellationToken) =>
221222
{
222223
int exitCode = 0;
223224

0 commit comments

Comments
 (0)
0