Skip to content
This repository has been archived by the owner on Oct 30, 2022. It is now read-only.

Commit

Permalink
Added #getCommands() method which can be used for help commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bastian committed Mar 30, 2016
1 parent 994e1fb commit 570fee8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions sdcf4j-core/src/main/java/de/btobastian/sdcf4j/CommandHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;

Expand Down Expand Up @@ -96,6 +97,16 @@ public boolean hasPermission(String userId, String permission) {
return false;
}

/**
* Gets a list with all commands in the order they were registered.
* This is useful for automatic help commands.
*
* @return A list with all commands the the order they were registered.
*/
public List<SimpleCommand> getCommands() {
return Collections.unmodifiableList(commandList);
}

/**
* Checks if you are allowed to do something with the given permission.
*
Expand Down

0 comments on commit 570fee8

Please sign in to comment.