Make top-level features return bool

This commit is contained in:
Matt Nadareski
2021-03-19 20:52:11 -07:00
parent c2fa50f28f
commit f109da2231
36 changed files with 221 additions and 87 deletions

View File

@@ -110,6 +110,7 @@ namespace RombaSharp
// Now process the current feature
Dictionary<string, Feature> features = _help.GetEnabledFeatures();
bool success = false;
switch (featureName)
{
case DisplayHelpDetailed.Value:
@@ -128,7 +129,7 @@ namespace RombaSharp
case Miss.Value:
case RescanDepots.Value:
VerifyInputs(feature.Inputs, featureName);
feature.ProcessFeatures(features);
success = feature.ProcessFeatures(features);
break;
// Requires no input verification
@@ -145,7 +146,7 @@ namespace RombaSharp
case RefreshDats.Value:
case Shutdown.Value:
case Features.Version.Value:
feature.ProcessFeatures(features);
success = feature.ProcessFeatures(features);
break;
// If nothing is set, show the help
@@ -154,6 +155,13 @@ namespace RombaSharp
break;
}
// If the feature failed, output help
if (!success)
{
logger.Error("An error occurred during processing!");
_help.OutputIndividualFeature(featureName);
}
LoggerImpl.Close();
return;
}