Skip to content

Support variable number of arguments idomatically via params T[] #15

@decaprime

Description

@decaprime

Support using params in last parameter to capture a typed array of the remaining parameters.

There's two approaches for this with VCF, capturing as params string[] for all arguments and letting commands handle or capturing as a VCF supported type. The second approach is more natural one for VCF, albeit more surface area.

Consider:

[Command("make team")]
void MakeTeam(ICommandContext ctx, string teamName, params Player[])

This signature would support using some Player converter, and try to convert all the parameters before invoking the method.

.make team "Just For Fun" Kelly Kevin Meredith Erin

Though honestly that was a pain to type just for this example, I wanted to put commas in the list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions