@@ -53,4 +53,11 @@ public @interface ShellMethod {
|
||||
*/
|
||||
String prefix() default "--";
|
||||
|
||||
/**
|
||||
* The command group which this command belongs to. The command group is used when printing a list of
|
||||
* commands to group related commands.
|
||||
* @return name of the command group
|
||||
*/
|
||||
String group() default "";
|
||||
|
||||
}
|
||||
|
||||
@@ -61,9 +61,10 @@ public class StandardMethodTargetRegistrar implements MethodTargetRegistrar {
|
||||
if (keys.length == 0) {
|
||||
keys = new String[] { Utils.unCamelify(method.getName()) };
|
||||
}
|
||||
String group = shellMapping.group();
|
||||
for (String key : keys) {
|
||||
Supplier<Availability> availabilityIndicator = findAvailabilityIndicator(keys, bean, method);
|
||||
MethodTarget target = new MethodTarget(method, bean, shellMapping.value(), availabilityIndicator);
|
||||
MethodTarget target = new MethodTarget(method, bean, shellMapping.value(), group, availabilityIndicator);
|
||||
registry.register(key, target);
|
||||
commands.put(key, target);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user