diff --git a/Content.Server/Objectives/Commands/ListObjectivesCommand.cs b/Content.Server/Objectives/Commands/ListObjectivesCommand.cs index d4bdf2fd29..1126cac24f 100644 --- a/Content.Server/Objectives/Commands/ListObjectivesCommand.cs +++ b/Content.Server/Objectives/Commands/ListObjectivesCommand.cs @@ -8,12 +8,10 @@ using Robust.Shared.Console; namespace Content.Server.Objectives.Commands { [AdminCommand(AdminFlags.Logs)] - public sealed class ListObjectivesCommand : IConsoleCommand + public sealed class ListObjectivesCommand : LocalizedCommands { - public string Command => "lsobjectives"; - public string Description => "Lists all objectives in a players mind."; - public string Help => "lsobjectives []"; - public void Execute(IConsoleShell shell, string argStr, string[] args) + public override string Command => "lsobjectives"; + public override void Execute(IConsoleShell shell, string argStr, string[] args) { var player = shell.Player as IPlayerSession; IPlayerData? data; @@ -23,14 +21,14 @@ namespace Content.Server.Objectives.Commands } else if (player == null || !IoCManager.Resolve().TryGetPlayerDataByUsername(args[0], out data)) { - shell.WriteLine("Can't find the playerdata."); + shell.WriteError(LocalizationManager.GetString("shell-target-player-does-not-exist")); return; } var mind = data.ContentData()?.Mind; if (mind == null) { - shell.WriteLine("Can't find the mind."); + shell.WriteError(LocalizationManager.GetString("shell-target-entity-does-not-have-message", ("missing", "mind"))); return; } @@ -46,5 +44,15 @@ namespace Content.Server.Objectives.Commands } } + + public override CompletionResult GetCompletion(IConsoleShell shell, string[] args) + { + if (args.Length == 1) + { + return CompletionResult.FromHintOptions(CompletionHelper.SessionNames(), LocalizationManager.GetString("shell-argument-username-hint")); + } + + return CompletionResult.Empty; + } } } diff --git a/Resources/Locale/en-US/objectives/commands/lsobjectives.ftl b/Resources/Locale/en-US/objectives/commands/lsobjectives.ftl new file mode 100644 index 0000000000..12ef1bce18 --- /dev/null +++ b/Resources/Locale/en-US/objectives/commands/lsobjectives.ftl @@ -0,0 +1,3 @@ +# lsobjectives +cmd-lsobjectives-desc = Lists all objectives in a players mind. +cmd-lsobjectives-help = Usage: lsobjectives diff --git a/Resources/Locale/en-US/shell.ftl b/Resources/Locale/en-US/shell.ftl index 48120503ac..fe69bb0c4a 100644 --- a/Resources/Locale/en-US/shell.ftl +++ b/Resources/Locale/en-US/shell.ftl @@ -42,3 +42,6 @@ shell-argument-number-must-be-between = Argument {$index} must be a number betwe shell-argument-station-id-invalid = Argument {$index} must be a valid station id! shell-argument-map-id-invalid = Argument {$index} must be a valid map id! shell-argument-number-invalid = Argument {$index} must be a valid number! + +# Hints +shell-argument-username-hint =