singhpk234 commented on code in PR #2762:
URL: https://github.com/apache/polaris/pull/2762#discussion_r2409014700
##########
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:
Agree, IMHO would also prefer to take this up in a follow-up, specially
realm is both the place would be tricky like what if for a realm --credential
had just client id and the --credetial-file has the secret do we merge ?
--
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]