commandMeta.setDefault(true);
commandMeta.setName(pluginMeta.getName());
// favor help text from this annotation over others
DefaultCommand def = Annotations.getAnnotation(method, DefaultCommand.class);
if ((def.help() != null) && !def.help().trim().isEmpty())
{
commandMeta.setHelp(def.help());
}
}
// This works because @SetupCommand is annotated by @Command
if (Annotations.isAnnotationPresent(method, SetupCommand.class))
{
if (pluginMeta.hasSetupCommand())
{
throw new IllegalStateException("Plugins may only have one @"
+ SetupCommand.class.getSimpleName()
+ ", but [" + pluginMeta.getType() + "] has more than one.");
}
commandMeta.setSetup(true);
commandMeta.setName("setup");
// favor help text from this annotation over others
SetupCommand def = Annotations.getAnnotation(method, SetupCommand.class);
if ((def.help() != null) && !def.help().trim().isEmpty())
{
commandMeta.setHelp(def.help());
}
}
/*
* We don't want to do this if it is a setup command.