DomGarguilo commented on code in PR #6012:
URL: https://github.com/apache/accumulo/pull/6012#discussion_r2608458299


##########
shell/src/main/java/org/apache/accumulo/shell/commands/CreateTableCommand.java:
##########
@@ -114,8 +117,22 @@ public int execute(final String fullCommand, final 
CommandLine cl, final Shell s
           + " only valid when using " + createTableOptCopyConfig.getLongOpt());
     }
 
-    if (cl.hasOption(createTableOptCopyConfig.getOpt())) {
-      final String oldTable = 
cl.getOptionValue(createTableOptCopyConfig.getOpt());
+    for (var copyOpt : copyConfigGroup.getOptions()) {
+      if (cl.hasOption(copyOpt) && (cl.hasOption(createTableNoDefaultIters)
+          || cl.hasOption(createTableNoDefaultTableProps) || 
cl.hasOption(createTableOptInitProp)
+          || cl.hasOption(createTableOptIteratorProps) || 
cl.hasOption(createTableOptFormatter)
+          || cl.hasOption(createTableOptLocalityProps) || 
cl.hasOption(createTableOptEVC))) {
+        throw new IllegalArgumentException(copyOpt.getLongOpt()
+            + " is mutually exclusive with any other option that sets 
per-table properties");
+      }
+    }
+
+    if (cl.hasOption(createTableOptCopyConfig.getOpt())
+        || cl.hasOption(createTableOptCopyProps.getOpt())) {
+      String oldTable = cl.getOptionValue(createTableOptCopyConfig.getOpt());

Review Comment:
   This is a general question for all `hasOption()` and `getOptionValue()` 
calls. Can we just use the simpler `hasOption(Option opt)` overload since we 
already have the `Option` object? Seems like we are using both overloads here 
so there might be a reason but I figured I would ask. Also there are a lot of 
both usages in the existing code which probably isnt worth changing here but it 
might be a simplicity improvement in the new code being added.



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