dimas-b commented on code in PR #2762:
URL: https://github.com/apache/polaris/pull/2762#discussion_r2411290138
##########
runtime/admin/src/main/java/org/apache/polaris/admintool/BootstrapCommand.java:
##########
@@ -35,20 +35,28 @@
description = "Bootstraps realms and root principal credentials.")
public class BootstrapCommand extends BaseCommand {
- @CommandLine.ArgGroup(multiplicity = "1")
- InputOptions inputOptions;
+ @CommandLine.Mixin InputOptions inputOptions;
static class InputOptions {
- @CommandLine.ArgGroup(multiplicity = "1", exclusive = false)
- StandardInputOptions stdinOptions;
-
+ // This ArgGroup enforces the mandatory, exclusive choice.
@CommandLine.ArgGroup(multiplicity = "1")
- FileInputOptions fileOptions;
+ ExclusiveOptions exclusiveOptions;
- @CommandLine.ArgGroup(multiplicity = "1")
- SchemaInputOptions schemaInputOptions;
+ // This @Mixin provides independent, optional schema flags.
+ @CommandLine.Mixin SchemaInputOptions schemaInputOptions = new
SchemaInputOptions();
+
+ // This static inner class encapsulates the mutually exclusive choices.
+ static class ExclusiveOptions {
+
+ @CommandLine.ArgGroup(exclusive = false, heading = "Standard Input
Options:%n")
+ StandardInputOptions stdinOptions;
+ @CommandLine.ArgGroup(exclusive = false, heading = "File Input
Options:%n")
+ FileInputOptions fileOptions;
Review Comment:
follow up is ok from my POV :+1:
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]