-
Notifications
You must be signed in to change notification settings - Fork 441
Closed
Labels
theme: parserAn issue or change related to the parserAn issue or change related to the parser
Description
I have a CLI root
command like the following
@Command(
name = "mock-cli",
mixinStandardHelpOptions = true,
subcommands = {
Create.class,
List.class,
Show.class
}
)
public class Cli implements Runnable {
@Override
public void run() {
new CommandLine(this).usage(System.out);
}
public static void main(String... args) {
CommandLine.run(new Cli(), System.out, args);
}
}
And a subcommand like this
@Command(name = "create", description = "creates a configuration or mapping")
public class Create implements Runnable {
@Command
public void config(@Parameters String name,
@Option(names = {"-t", "--mime-type"}) java.util.List<MimeType> mimeTypes,
@Option(names = {"-p", "--proxy"}) String proxy) {
try (Writer writer = Files.newBufferedWriter(Paths.get("service/conf/mock-services", name + ".conf"))) {
compile("create/config")
.render(Maps.of("name", name,
"upperName", name.toUpperCase(),
"mimeTypes", mimeTypes,
"proxy", proxy),
writer);
} catch (IOException e) {
// TODO
}
}
@Override
public void run() {
new CommandLine(this).usage(out);
}
}
Now, this works fine so far but I wonder how to configure enum case-insensitivity on the Commandline
object? And where? One the root
command`?
haroldo-ok
Metadata
Metadata
Assignees
Labels
theme: parserAn issue or change related to the parserAn issue or change related to the parser