Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Argument#thenRecursive #529

@GliczDev

Description

@GliczDev

Description

Well, when using CommandTrees, arguments can sometimes look like that:

.then(new LiteralArgument("arg1")
    .then(new StringArgument("arg2")
        .then(new StringArgument("arg3")
            .then(new DoubleArgument("arg4", 0)
                .then(new StringArgument("arg5"))))))

and it looks... bad. (well, it can be a BIG tree)

Expected code

I suggest that there should be a method called thenRecursive in Argument class. It would work just like the code above, however, it would look more like:

.thenRecusvie(
    new LiteralArgument("arg1"),
    new StringArgument("arg2"),
    new StringArgument("arg3"),
    new DoubleArgument("arg4", 0),
    new StringArgument("arg5")
)

and it looks much more clean!

Extra details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestimplemented for next releaseThis has been implemented in the current dev build for the next public release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions