PakhomovAlexander commented on code in PR #2339:
URL: https://github.com/apache/ignite-3/pull/2339#discussion_r1272503806
##########
modules/cli/src/main/java/org/apache/ignite/internal/cli/commands/Options.java:
##########
@@ -258,5 +258,23 @@ public static final class Constants {
public static final String CLUSTER_CONFIG_FILE_OPTION_SHORT = "-cfgf";
public static final String CLUSTER_CONFIG_FILE_OPTION_DESC = "Path to
cluster configuration file";
+
+ public static final String PASSWORD_OPTION = "--password";
+
+ public static final String PASSWORD_OPTION_SHORT = "--p";
+
+ public static final String PASSWORD_OPTION_DESC = "Password to connect
to cluster";
+
+ public static final String USERNAME_OPTION = "--username";
+
+ public static final String USERNAME_OPTION_SHORT = "--u";
Review Comment:
Same here for single dash
##########
modules/cli/src/main/java/org/apache/ignite/internal/cli/commands/connect/ConnectOptions.java:
##########
@@ -0,0 +1,39 @@
+package org.apache.ignite.internal.cli.commands.connect;
+
+import static
org.apache.ignite.internal.cli.commands.Options.Constants.PASSWORD_OPTION;
+import static
org.apache.ignite.internal.cli.commands.Options.Constants.PASSWORD_OPTION_DESC;
+import static
org.apache.ignite.internal.cli.commands.Options.Constants.PASSWORD_OPTION_SHORT;
+import static
org.apache.ignite.internal.cli.commands.Options.Constants.USERNAME_OPTION;
+import static
org.apache.ignite.internal.cli.commands.Options.Constants.USERNAME_OPTION_DESC;
+import static
org.apache.ignite.internal.cli.commands.Options.Constants.USERNAME_OPTION_SHORT;
+
+import org.jetbrains.annotations.Nullable;
+import picocli.CommandLine.Option;
+
+/**
+ * Mixin class for connect command options.
+ */
+public class ConnectOptions {
+
+
+ @Option(names = {USERNAME_OPTION, USERNAME_OPTION_SHORT}, description =
USERNAME_OPTION_DESC)
+ private String username;
+
+ @Option(names = {PASSWORD_OPTION, PASSWORD_OPTION_SHORT}, description =
PASSWORD_OPTION_DESC)
+ private String password;
Review Comment:
I mean I should not be able to run command like `connect --username
<username` but I can. I expect a message from Picocli explaining that I should
use both `--username` and `--password` or non of them.
--
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]