eric-maynard commented on code in PR #2762:
URL: https://github.com/apache/polaris/pull/2762#discussion_r2408972952


##########
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:
   Conceptually I think you're right, though merging a conflict across 
`--credential` and `--credentials-file` is nontrivial, so I think it's okay if 
we want to leave that edge case out.



-- 
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]

Reply via email to