Paul2708 / simple-commands

An (even more) simplified and intuitive command framework for Spigot.
MIT License
14 stars 2 forks source link

Added support for optional arguments #42

Closed nea89o closed 4 years ago

nea89o commented 4 years ago

Pull Request Template

Checklist

Make sure that you completed the following actions to submitting this PR.

I can't run mvn checkstyle:check as all mvn commands fail for me. However i tested my IDEs build tool which worked and also didn't find any style issues. So this is something rather to my maven setup which can't be fixed rn.

Title

Added support for optional arguments.

Description

This adds support for optional arguments via an @Optional annotation. If this annotation is applied to an argument this argument will be skipped during argument parsing if the CommandArgument returns an invalid Validator. The method will have a null passed instead.

This should be backwards compatible.

Issue Resolution

Closes #11

Proposed Changes

Paul2708 commented 4 years ago

Thanks for contributing and applying the code style rules although the maven command doesn't work out for you. I already read #43 and I will definitely have a look in it! Thank you.