Eluinhost/pluginframework — pull request #3 by Eluinhost (2014-07-31 14:52:03+00:00)
Title: Optioned Commands

Adds a new command framework that uses the following system:

```java
@CommandMethod(command = "name", options = true)
public void command(CommandRequest request)
{
request.sendMessage(request.getOptions().valueOf("-t"));
}

public String[] command(OptionParser parser)
{
parser.accepts("t").withRequiredArg().describedAs("Word to repeat");
return new String[]{"t"}; //return the required options
}

@CommandMethod(command = "noarg")
public void noargcommand(CommandRequest request)
{
request.sendMessage(request.getFirstArg());
}
```

With the examples above the following would happen:

`/name -t=print` => `print`
`/name -t print` => `print`
`/name --t=print` => `print`
`/name` => `prints option info`
`/noarg something` => `something`