Open MCMDEV opened 3 years ago
Definitely possible within the current implementation. I don't currently have time to look into this however, so feel free to open a PR.
Should be able to just add a tab complete listener for strings starting with the flag key (-
)
I'd like to suggest some improvements on flag parsing and the autocompletion of flags. This is more of a collection of issues which are all closely related to one another. I have written a little report on the current situation and how I think an implementation could look like, hoping make the actual development a bit easier.
Current Behaviour:
First Example: This example uses three flags of different types Code:
Issues: Flags cannot be completed:
In this example, there is always a boolean-value suggested after the second flag, regardless of order:
Second Example: This example uses three booleans: Code:
Issues:
In here, the second suggestion is a boolean-value:
When having a boolean-flag enclosed in two other boolean-flag, it does not get parsed:
Group parsing is not supported:
Proposal for expected behaviour:
My idea would be to mimick the behaviour of WorldEdit, as this libary is already inspired and their solution is good.
Tab-Completion of flags
Tab-Completion of grouped flags:
Ability to group boolean and value flags with one value flag being able to end a group:
I know it's a lot to ask for, but it might be something to have on the radar.