sk89q/worldedit — pull request #228 by Silthus (2012-12-29 09:52:05+00:00)
Title: Adds possibility to execute method body of a @NestedCommand tagged command

Hi,

lets try this again without me bitching around and with nice code standards, one commit and a use case ;)

Changes:
* Added boolean executeBody() to @NestedCommand that defaults to false
* Before dispatching the command to the method body it will now check if the command has 0 args and executeBody=true - if so it will execute the body of the tagged method.

Because the executeBody defaults to false it wont do anything anywhere until the param is used. All commands will work like before but new functionality is added to people who might want to use it.

Use Case:
Lets say you have a plugin that has the following command tree:
/myplugin
/myplugin add
/myplugin remove
/myplugin list
At the moment I could do all of that but dont display information to the player when he only executes /myplugin. It will always display him the following help: /myplugin

Now if the base method has executeBody=true it will execute the body of that /myplugin base command and gives you the possibility to display information to the player.