Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subcommands of subcommands #21

Open
inxomnyaa opened this issue Oct 16, 2019 · 2 comments
Open

Subcommands of subcommands #21

inxomnyaa opened this issue Oct 16, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@inxomnyaa
Copy link
Collaborator

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"));
    }
@CortexPE
Copy link
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

@CortexPE CortexPE added the enhancement New feature or request label Mar 20, 2020
@inxomnyaa
Copy link
Collaborator Author

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
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants