Annotation Interface Command
This annotation indicates a command. Methods should be marked with this
annotation to tell
CommandsManager
that the method is a command.
Note that the method name can actually be anything.-
Required Element Summary
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionboolean
Get whether any flag can be used.Flags allow special processing for flags such as -h in the command, allowing users to easily turn on a flag.int
The maximum number of arguments.int
The minimum number of arguments.boolean
Should the command be queuedUsage instruction.
-
Element Details
-
aliases
String[] aliasesA list of aliases for the command. The first alias is the most important -- it is the main name of the command. (The method name is never used for anything).- Returns:
- Aliases for a command
-
usage
String usageUsage instruction. Example text for usage could be[-h harps] [name] [message]
.- Returns:
- Usage instructions for a command
- Default:
""
-
desc
String desc- Returns:
- A short description for the command.
-
min
int minThe minimum number of arguments. This should be 0 or above.- Returns:
- the minimum number of arguments
- Default:
0
-
max
int maxThe maximum number of arguments. Use -1 for an unlimited number of arguments.- Returns:
- the maximum number of arguments
- Default:
-1
-
flags
String flagsFlags allow special processing for flags such as -h in the command, allowing users to easily turn on a flag. This is a string with each character being a flag. Use A-Z and a-z as possible flags. Appending a flag with a : makes the flag character before a value flag, meaning that if it is given it must have a value- Returns:
- Flags matching a-zA-Z
- Default:
""
-
help
String help- Returns:
- A long description for the command.
- Default:
""
-
anyFlags
boolean anyFlagsGet whether any flag can be used.- Returns:
- true if so
- Default:
false
-
queued
boolean queuedShould the command be queued- Returns:
- true if so
- Default:
true
-