diff --git a/Content.Server/Administration/Commands/WarpCommand.cs b/Content.Server/Administration/Commands/WarpCommand.cs index 69ad871f78..11f62216a9 100644 --- a/Content.Server/Administration/Commands/WarpCommand.cs +++ b/Content.Server/Administration/Commands/WarpCommand.cs @@ -38,12 +38,7 @@ namespace Content.Server.Administration.Commands var location = args[0]; if (location == "?") { - var locations = string.Join(", ", - entMan.EntityQuery(true) - .Select(p => p.Location) - .Where(p => p != null) - .OrderBy(p => p) - .Distinct()); + var locations = string.Join(", ", GetWarpPointNames(entMan)); shell.WriteLine(locations); } @@ -121,5 +116,27 @@ namespace Content.Server.Administration.Commands } } } + + private static IEnumerable GetWarpPointNames(IEntityManager entMan) + { + return entMan.EntityQuery(true) + .Select(p => p.Location) + .Where(p => p != null) + .OrderBy(p => p) + .Distinct()!; + } + + public CompletionResult GetCompletion(IConsoleShell shell, string[] args) + { + if (args.Length == 1) + { + var ent = IoCManager.Resolve(); + var options = new[] { "?" }.Concat(GetWarpPointNames(ent)); + + return CompletionResult.FromHintOptions(options, ""); + } + + return CompletionResult.Empty; + } } }