commands
commands copied to clipboard
Support @CommandAlias on parent classes
This should define:
/feature help
/feature foo hello
/feature foo world
with the following
@CommandAlias("feature")
public class FeatureCommand extends BaseCommand {
@HelpCommand
public void onHelp(CommandHelp help) { help.showHelp(); }
}
@Subcommand("foo")
public class FeatureGroup1 extends FeatureCommand {
@Subcommand("hello")
public void onHello() { }
}
@Subcommand("bar")
public class FeatureGroup2 extends FeatureCommand {
@Subcommand("world")
public void onWorld() { }
}
We need to check inheritance of the class to find @CommandAlias. This avoids duplicating it over multiple multiple classes, forcing you to use replacements to make it managed in 1 place (which is decoupled)
If we encounter multiple command aliases above the BaseCommand, they should be merged.
Has this got any progress? I would find this extremely useful, especially as it would make sense to be able to add subcommands by extending the base command.