Support ancient .NET in Help

This commit is contained in:
Matt Nadareski
2024-02-28 23:14:21 -05:00
parent c2973beb7f
commit 010a2d4cec
4 changed files with 25 additions and 6 deletions

View File

@@ -207,14 +207,14 @@ namespace SabreTools.Help
}
// If we have a match within the flags
else if (_features[feature]!.ContainsFlag(featurename))
else if (_features[feature]!.ContainsFlag(featurename!))
{
realname = feature;
break;
}
// Otherwise, we want to get features with the same start
else if (_features[feature]!.StartsWith(featurename.TrimStart('-')[0]))
else if (_features[feature]!.StartsWith(featurename!.TrimStart('-')[0]))
{
startsWith.Add(feature);
}
@@ -284,7 +284,7 @@ namespace SabreTools.Help
private Dictionary<string, Feature?> GetEnabledSubfeatures(string key, Feature? feature)
{
Dictionary<string, Feature?> enabled = [];
// If the feature is invalid
if (feature == null)
return enabled;
@@ -340,7 +340,9 @@ namespace SabreTools.Help
/// </summary>
private static void Pause()
{
#if NET452_OR_GREATER || NETCOREAPP
if (!Console.IsOutputRedirected)
#endif
{
Console.WriteLine();
Console.WriteLine("Press enter to continue...");