diff --git a/build/Packages.props b/build/Packages.props index 90f4da26b9..f779ef748b 100644 --- a/build/Packages.props +++ b/build/Packages.props @@ -18,7 +18,7 @@ - + diff --git a/src/OmniSharp.Host/CommandLineApplication.cs b/src/OmniSharp.Host/CommandLineApplication.cs index 17ba4c54f4..2f3861ce4b 100644 --- a/src/OmniSharp.Host/CommandLineApplication.cs +++ b/src/OmniSharp.Host/CommandLineApplication.cs @@ -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); @@ -62,15 +65,25 @@ public int Execute(string[] args) return Application.Execute(args.Except(OtherArgs).ToArray()); } + [Obsolete("Please use OnExecuteAsync instead")] public void OnExecute(Func> func) { - Application.OnExecute(() => + Application.OnExecuteAsync((_) => { DebugAttach(); return func(); }); } + public void OnExecuteAsync(Func> func) + { + Application.OnExecuteAsync((token) => + { + DebugAttach(); + return func(token); + }); + } + public void OnExecute(Func func) { Application.OnExecute(() =>