mirror of
https://github.com/jlengrand/picocli.git
synced 2026-03-10 08:41:17 +00:00
[#699] added support for @Spec and @ParentCommand elements
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
"allDeclaredMethods" : true,
|
||||
"allPublicMethods" : true,
|
||||
"fields" : [
|
||||
{ "name" : "parent" },
|
||||
{ "name" : "recursive" }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import picocli.CommandLine.Command;
|
||||
import picocli.CommandLine.Mixin;
|
||||
import picocli.CommandLine.Model.ArgSpec;
|
||||
import picocli.CommandLine.Model.CommandSpec;
|
||||
import picocli.CommandLine.Model.IAnnotatedElement;
|
||||
import picocli.CommandLine.Model.IGetter;
|
||||
import picocli.CommandLine.Model.IScope;
|
||||
import picocli.CommandLine.Model.ISetter;
|
||||
@@ -148,6 +149,7 @@ public class ReflectionConfigGenerator {
|
||||
int.class.getName(), int[].class.getName(), int[].class.getCanonicalName(),
|
||||
long.class.getName(), long[].class.getName(), long[].class.getCanonicalName(),
|
||||
short.class.getName(), short[].class.getName(), short[].class.getCanonicalName(),
|
||||
CommandSpec.class.getName(),
|
||||
Method.class.getName(),
|
||||
Object.class.getName(),
|
||||
String.class.getName(),
|
||||
@@ -208,6 +210,14 @@ public class ReflectionConfigGenerator {
|
||||
visitGetter(binding.getter());
|
||||
visitSetter(binding.setter());
|
||||
}
|
||||
for (IAnnotatedElement specElement : spec.specElements()) {
|
||||
visitGetter(specElement.getter());
|
||||
visitSetter(specElement.setter());
|
||||
}
|
||||
for (IAnnotatedElement parentCommandElement : spec.parentCommandElements()) {
|
||||
visitGetter(parentCommandElement.getter());
|
||||
visitSetter(parentCommandElement.setter());
|
||||
}
|
||||
for (OptionSpec option : spec.options()) {
|
||||
visitArgSpec(option);
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
{ "name" : "file", "parameterTypes" : [] },
|
||||
{ "name" : "minimum", "parameterTypes" : [] },
|
||||
{ "name" : "otherFiles", "parameterTypes" : [] },
|
||||
{ "name" : "spec", "parameterTypes" : [] },
|
||||
{ "name" : "timeUnit", "parameterTypes" : [] }
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user