Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a new annotation to hide commands from tabcompletion and help #124

Merged
merged 2 commits into from Apr 20, 2018

Conversation

Projects
None yet
2 participants
@MiniDigger
Copy link
Contributor

commented Apr 19, 2018

implements #123

seems to work fine
https://i.imgur.com/4uyszvl.png

@MiniDigger MiniDigger changed the title add a new annotation to hide commands from tabcompletion and help (implements #123) add a new annotation to hide commands from tabcompletion and help Apr 19, 2018

@@ -518,6 +519,10 @@ public boolean canExecute(CommandIssuer issuer, RegisteredCommand<?> cmd) {
continue;
}

if(value.method.isAnnotationPresent(Private.class)){

This comment has been minimized.

Copy link
@aikar

aikar Apr 19, 2018

Owner

Please look up the annotation in the RegisteredCommand ctor, and store a boolean there, and use the annotations class like everything else does

@@ -65,6 +66,11 @@ public CommandHelp(CommandManager manager, RootCommand rootCommand, CommandIssue
}

RegisteredCommand regCommand = e.getValue();

if(regCommand.method.isAnnotationPresent(Private.class)){

This comment has been minimized.

Copy link
@aikar

aikar Apr 19, 2018

Owner

same as above, reference a boolean on RegisteredCommand here instead

@aikar

aikar approved these changes Apr 20, 2018

@aikar aikar merged commit 95fe457 into aikar:master Apr 20, 2018

@MiniDigger MiniDigger deleted the MiniDigger:private-annoation branch Apr 20, 2018

MiniDigger added a commit to MiniDigger/commands that referenced this pull request Apr 20, 2018

aikar added a commit that referenced this pull request Apr 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.