Show "null" in loglevel command completions

This was already supported, but the completions didn't list it.
This commit is contained in:
PJB3005
2025-01-07 21:33:37 +01:00
parent 57291b88c0
commit 1984e97d2f
2 changed files with 5 additions and 3 deletions

View File

@@ -51,7 +51,7 @@ END TEMPLATE-->
### Other
*None yet*
* The `loglevel` command now properly shows the "`null`" log level that resets the level to inheriting from parent. This was already supported by it, but the completions didn't list it.
### Internal

View File

@@ -7,6 +7,8 @@ namespace Robust.Shared.Console.Commands;
internal sealed class LogSetLevelCommand : LocalizedCommands
{
private const string LevelNull = "null";
[Dependency] private readonly ILogManager _logManager = default!;
public override string Command => "loglevel";
@@ -21,7 +23,7 @@ internal sealed class LogSetLevelCommand : LocalizedCommands
var name = args[0];
var levelname = args[1];
LogLevel? level;
if (levelname == "null")
if (levelname == LevelNull)
{
level = null;
}
@@ -49,7 +51,7 @@ internal sealed class LogSetLevelCommand : LocalizedCommands
"<sawmill>");
case 2:
return CompletionResult.FromHintOptions(
Enum.GetNames<LogLevel>(),
Enum.GetNames<LogLevel>().Union([LevelNull]),
"<level>");
default: