Skip to content

Commit

Permalink
Added commands header
Browse files Browse the repository at this point in the history
  • Loading branch information
Nan1t committed Jul 1, 2022
1 parent c8a3284 commit e0e5a4a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/main/java/ru/nanit/limbo/server/commands/CmdHelp.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import ru.nanit.limbo.server.Command;
import ru.nanit.limbo.server.LimboServer;
import ru.nanit.limbo.server.Logger;

import java.util.Map;

Expand All @@ -15,19 +16,13 @@ public CmdHelp(LimboServer server) {

@Override
public void execute() {
StringBuilder msg = new StringBuilder();
Map<String, Command> commands = server.getCommandManager().getCommands();

Logger.info("Available commands:");

for (Map.Entry<String, Command> entry : commands.entrySet()) {
msg.append("\n");
msg.append(entry.getKey());
msg.append(" - ");
msg.append(entry.getValue().description());
Logger.info("%s - %s", entry.getKey(), entry.getValue().description());
}

msg.append("\n");

System.out.println(msg);
}

@Override
Expand Down
1 change: 1 addition & 0 deletions src/main/java/ru/nanit/limbo/server/commands/CmdMem.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public void execute() {
long free = runtime.freeMemory() / mb;
long max = runtime.maxMemory() / mb;

Logger.info("Memory usage:");
Logger.info("Used: %d MB", used);
Logger.info("Total: %d MB", total);
Logger.info("Free: %d MB", free);
Expand Down

0 comments on commit e0e5a4a

Please sign in to comment.