Commando icon indicating copy to clipboard operation
Commando copied to clipboard

Subcommands of subcommands

Open inxomnyaa opened this issue 6 years ago • 2 comments

Any chance of adding support for nested commands? I once again have stumbled across a situation where arguments are not satisfying my situation, and i would need subcommands that have subcommands

Example:

| - /base
| - /base test (arg)
| - /base entity (subcmd)
| - - /base entity remove (arg)
| - - /base entity name <name> (sub subcmd + arg)
| - - /base entity move (sub subcmd)

Or in code style:

class EntitySubCommand extends BaseSubCommand
{
    protected function prepare(): void
    {
        $this->registerArgument(0, new EntityTypeArgument("type", false));
        $this->registerArgument(1, new RawStringArgument("name", false));
        $this->setPermission("plugin.entity");
        $this->registerSubCommand(new PropertiesEntitySubCommand("properties", "Change properties of the entity"));
    }

inxomnyaa avatar Oct 16 '19 14:10 inxomnyaa

contributions welcome 😁

I once thought of adding this before... But I'm too busy so I'm only aiming to make the virion more stable and consisistent

CortexPE avatar Oct 26 '19 03:10 CortexPE

I don't understand my own request anymore

inxomnyaa avatar Apr 04 '22 12:04 inxomnyaa