Clean up descriptions

This commit is contained in:
Alexander Söderberg 2020-09-23 20:55:17 +02:00
parent b0cd22886d
commit 3b2ccdca14
No known key found for this signature in database
GPG key ID: C0207FF7EA146678
10 changed files with 281 additions and 37 deletions

View file

@ -80,7 +80,8 @@ public final class AnnotationParser<C> {
this.manager = manager;
this.metaFactory = new MetaFactory(this, metaMapper);
this.annotationMappers = Maps.newHashMap();
this.registerAnnotationMapper(Description.class, d -> ParserParameters.single(StandardParameters.DESCRIPTION, d.value()));
this.registerAnnotationMapper(CommandDescription.class, d ->
ParserParameters.single(StandardParameters.DESCRIPTION, d.value()));
}
/**
@ -181,7 +182,7 @@ public final class AnnotationParser<C> {
}
final String description = argumentDescriptions.getOrDefault(argument, "");
builder = builder.argument(argument, description);
builder = builder.argument(argument, com.intellectualsites.commands.Description.of(description));
}
}
/* Try to find the command sender type */

View file

@ -33,7 +33,7 @@ import java.lang.annotation.Target;
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Description {
public @interface CommandDescription {
/**
* Command description