Skip to content

Commit

Permalink
Upgrade McMaster.Extensions.CommandLineUtils to 3.1.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbp committed Jul 22, 2021
1 parent 672be4f commit 05d269b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion build/Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<PackageReference Update="Dotnet.Script.DependencyModel.NuGet" Version="1.1.0" />
<PackageReference Update="ICSharpCode.Decompiler" Version="7.1.0.6543" />

<PackageReference Update="McMaster.Extensions.CommandLineUtils" Version="2.2.4" />
<PackageReference Update="McMaster.Extensions.CommandLineUtils" Version="3.1.0" />

<PackageReference Update="Microsoft.AspNetCore.Diagnostics" Version="$(AspNetCorePackageVersion)" />
<PackageReference Update="Microsoft.AspNetCore.Hosting" Version="$(AspNetCorePackageVersion)" />
Expand Down
14 changes: 4 additions & 10 deletions src/OmniSharp.Host/CommandLineApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ public class CommandLineApplication

public CommandLineApplication()
{
Application = new McMaster.Extensions.CommandLineUtils.CommandLineApplication(throwOnUnexpectedArg: false);
Application = new McMaster.Extensions.CommandLineUtils.CommandLineApplication
{
UnrecognizedArgumentHandling = UnrecognizedArgumentHandling.StopParsingAndCollect
};
Application.HelpOption("-? | -h | --help");

_applicationRoot = Application.Option("-s | --source", "Solution or directory for OmniSharp to point at (defaults to current directory).", CommandOptionType.SingleValue);
Expand Down Expand Up @@ -62,15 +65,6 @@ public int Execute(string[] args)
return Application.Execute(args.Except(OtherArgs).ToArray());
}

public void OnExecute(Func<Task<int>> func)
{
Application.OnExecute(() =>
{
DebugAttach();
return func();
});
}

public void OnExecute(Func<int> func)
{
Application.OnExecute(() =>
Expand Down

0 comments on commit 05d269b

Please sign in to comment.