Paul2708 / simple-commands

An (even more) simplified and intuitive command framework for Spigot.
MIT License
14 stars 2 forks source link

Add sub commands #14

Closed Paul2708 closed 4 years ago

Paul2708 commented 5 years ago

Description

As some commands need sub commands it would be great to provided them by the framework itself.

Usage

Implementation idea You could use @CommandGroup instead of @Command. I do not have any further ideas yet.

nea89o commented 5 years ago

One would probably want a common baseclass for Commands and CommandGroups. One idea would be to have a call or execute method which in commands just executes the normal command and in a commandgroup would match the first argument against all subcommands and either call one of those commands with the arguments - the first one, or would call a fallback like showing help, or executing another method.