aikar / aikar/commands

Add @ConsumesRest annotation

未关闭
#431 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Java
星标
628
派生
150
PR 合并指标
30 天内没有已合并 PR

描述

For example, I have my own parsing logic for flags where the order does not matter:
```
/mv entities --name test --eat
/mv entities --eat
/mv entities --eat --name test
```

Currently what I have to do is as ACF only allows String[] and String to parse more than 1 command arg:
```
void onCommand(... String[] flagArr) {
Flags flags = parseFlags(flagArr);
// ...
}
```

My suggestion is add a @ConsumesRest annotation which will allow our own custom classes to consume all the args as well, e.g.:
```
void onCommand(... @ConsumesRest Flags flag) {
}

// Command context for Flags will be registered
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。