mirror of
https://github.com/spectreconsole/spectre.console.git
synced 2025-10-25 15:19:23 +00:00
Add top-level CancellationToken support to Spectre.Console.Cli
Also raise CA2016 (forward the CancellationToken parameter to methods that take one) to warning Fixes #701
This commit is contained in:
committed by
Patrik Svensson
parent
d90e94dbb3
commit
f5f61ca610
@@ -18,6 +18,7 @@ internal sealed class CommandAppSettings : ICommandAppSettings
|
||||
public HelpProviderStyle? HelpProviderStyles { get; set; }
|
||||
public bool StrictParsing { get; set; }
|
||||
public bool ConvertFlagsToRemainingArguments { get; set; }
|
||||
public int CancellationExitCode { get; set; }
|
||||
|
||||
public ParsingMode ParsingMode =>
|
||||
StrictParsing ? ParsingMode.Strict : ParsingMode.Relaxed;
|
||||
@@ -33,6 +34,7 @@ internal sealed class CommandAppSettings : ICommandAppSettings
|
||||
TrimTrailingPeriod = true;
|
||||
HelpProviderStyles = HelpProviderStyle.Default;
|
||||
ConvertFlagsToRemainingArguments = false;
|
||||
CancellationExitCode = 130;
|
||||
}
|
||||
|
||||
public bool IsTrue(Func<CommandAppSettings, bool> func, string environmentVariableName)
|
||||
|
||||
Reference in New Issue
Block a user