summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/Commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI/Framework/Commands')
-rw-r--r--src/SMAPI/Framework/Commands/HelpCommand.cs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/SMAPI/Framework/Commands/HelpCommand.cs b/src/SMAPI/Framework/Commands/HelpCommand.cs
index eb6c74f5..65dc3bce 100644
--- a/src/SMAPI/Framework/Commands/HelpCommand.cs
+++ b/src/SMAPI/Framework/Commands/HelpCommand.cs
@@ -1,5 +1,3 @@
-#nullable disable
-
using System.Linq;
namespace StardewModdingAPI.Framework.Commands
@@ -41,7 +39,7 @@ namespace StardewModdingAPI.Framework.Commands
{
if (args.Any())
{
- Command result = this.CommandManager.Get(args[0]);
+ Command? result = this.CommandManager.Get(args[0]);
if (result == null)
monitor.Log("There's no command with that name. Type 'help' by itself for more info.", LogLevel.Error);
else
@@ -63,10 +61,10 @@ namespace StardewModdingAPI.Framework.Commands
+ "--------------\n"
+ "The following commands are registered. For more info about a command, type 'help command_name'.\n\n";
- IGrouping<string, string>[] groups = (from command in this.CommandManager.GetAll() orderby command.Mod?.DisplayName, command.Name group command.Name by command.Mod?.DisplayName).ToArray();
+ IGrouping<string, string>[] groups = (from command in this.CommandManager.GetAll() orderby command.Mod?.DisplayName, command.Name group command.Name by command.Mod?.DisplayName ?? "SMAPI").ToArray();
foreach (var group in groups)
{
- string modName = group.Key ?? "SMAPI";
+ string modName = group.Key;
string[] commandNames = group.ToArray();
message += $"{modName}:\n {string.Join("\n ", commandNames)}\n\n";
}