Add listroles command (#5533)

This commit is contained in:
wrexbe
2021-11-26 22:43:49 -08:00
committed by GitHub
parent 7792c0b5f1
commit 1a39807ce5

View File

@@ -0,0 +1,34 @@
using Content.Server.Administration;
using Content.Shared.Administration;
using Content.Shared.Roles;
using Robust.Shared.Console;
using Robust.Shared.IoC;
using Robust.Shared.Prototypes;
namespace Content.Server.Roles
{
[AdminCommand(AdminFlags.Fun)]
public class ListRolesCommand : IConsoleCommand
{
public string Command => "listroles";
public string Description => "Lists roles";
public string Help => "listroles";
public void Execute(IConsoleShell shell, string argStr, string[] args)
{
if (args.Length != 0)
{
shell.WriteLine("Expected no arguments.");
return;
}
var prototypeManager = IoCManager.Resolve<IPrototypeManager>();
foreach(var job in prototypeManager.EnumeratePrototypes<JobPrototype>())
{
shell.WriteLine(job.ID);
}
}
}
}