Revxrsal / Lamp

A powerful, extendable, flexible yet simple to use commands annotation framework.
MIT License
171 stars 33 forks source link

@Optional or @Default not working correctly together @Flag #56

Closed bivashy closed 1 year ago

bivashy commented 1 year ago

When we are defining @Optional and @Flag at the same time, value of parameter will be <?null> Example command:

@Command("test")
public class TestCommand {
    @DefaultFor("test")
    public void onDefault(String first, @Flag("second") @Optional String second) {
        System.out.println(first);
        System.out.println(second);
    }
}

When we execute /test 1 It`ll print out:

1
<?null>

(Second value is plain String)

Revxrsal commented 1 year ago

Fixed in https://github.com/Revxrsal/Lamp/commit/15212537897c3f68ba394711059dff2e4fddb94b