Incendo / cloud

Command framework & dispatcher for the JVM
https://cloud.incendo.org
MIT License
433 stars 54 forks source link

Optional arguments doesn't work on v2 #705

Closed Syrent closed 7 months ago

Syrent commented 7 months ago

After adopting Cloud V2, I've encountered an issue with optional values not functioning as intended, or it's possible I may have misconfigured something in my code.

Snippet from my code:

optional("leader", StringParser.stringParser()) {
    defaultValue(DefaultValue.dynamic { context ->
        context.stickySender().name
    })
}

stickySender is one of my kotlin extensions

Result: image

jpenilla commented 7 months ago

https://github.com/Incendo/cloud/commit/4dad1cd732d286dee315a4ee94dd8d1a1d13bc50