Skip to content

Subcommands of subcommands #21

Description

@inxomnyaa

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"));
    }

Activity

  1. CortexPE commented on Oct 26, 2019

    @CortexPE
    Owner

    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

  2. inxomnyaa commented on Apr 4, 2022

    @inxomnyaa
    CollaboratorAuthor

    I don't understand my own request anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions