Commit 5754a76b authored by unknown's avatar unknown

WL#3298: IM: make command-line option names consistent

1. Removed '-P' command line option;
2. Renamed '--passwd' command line option to '--print-password-line'.


mysql-test/t/im_cmd_line.imtest:
  Renamed "--passwd" to "--print-password-line".
server-tools/instance-manager/options.cc:
  1. Removed '-P' option;
  2. Renamed '--passwd' to '--print-password-line'.
server-tools/instance-manager/user_management_commands.cc:
  Renamed class Passwd_cmd to Print_password_line_cmd.
server-tools/instance-manager/user_management_commands.h:
  Renamed class Passwd_cmd to Print_password_line_cmd.
parent 1e56f376
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
--echo --echo
--echo --> Printing out line for 'testuser'... --echo --> Printing out line for 'testuser'...
--exec $IM_EXE --defaults-file="$IM_DEFAULTS_PATH" --passwd --username=testuser --password=abc | tail -1 --exec $IM_EXE --defaults-file="$IM_DEFAULTS_PATH" --print-password-line --username=testuser --password=abc | tail -1
--echo --echo
--echo --> Listing users... --echo --> Listing users...
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
--echo --echo
--echo --> Printing out line for 'testuser'... --echo --> Printing out line for 'testuser'...
--exec $IM_EXE --defaults-file="$IM_DEFAULTS_PATH" --passwd --username=testuser --password=xyz | tail -1 --exec $IM_EXE --defaults-file="$IM_DEFAULTS_PATH" --print-password-line --username=testuser --password=xyz | tail -1
--echo --echo
--echo --> Listing users... --echo --> Listing users...
......
...@@ -114,7 +114,6 @@ static const int ANGEL_PID_FILE_SUFFIX_LEN= strlen(ANGEL_PID_FILE_SUFFIX); ...@@ -114,7 +114,6 @@ static const int ANGEL_PID_FILE_SUFFIX_LEN= strlen(ANGEL_PID_FILE_SUFFIX);
*/ */
enum options { enum options {
OPT_PASSWD= 'P',
OPT_USERNAME= 'u', OPT_USERNAME= 'u',
OPT_PASSWORD= 'p', OPT_PASSWORD= 'p',
OPT_LOG= 256, OPT_LOG= 256,
...@@ -135,6 +134,7 @@ enum options { ...@@ -135,6 +134,7 @@ enum options {
OPT_PORT, OPT_PORT,
OPT_WAIT_TIMEOUT, OPT_WAIT_TIMEOUT,
OPT_BIND_ADDRESS, OPT_BIND_ADDRESS,
OPT_PRINT_PASSWORD_LINE,
OPT_ADD_USER, OPT_ADD_USER,
OPT_DROP_USER, OPT_DROP_USER,
OPT_EDIT_USER, OPT_EDIT_USER,
...@@ -225,8 +225,8 @@ static struct my_option my_long_options[] = ...@@ -225,8 +225,8 @@ static struct my_option my_long_options[] =
(gptr *) &Options::Main::mysqld_safe_compatible, (gptr *) &Options::Main::mysqld_safe_compatible,
0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 0, 0 }, 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 0, 0 },
{ "passwd", OPT_PASSWD, { "print-password-line", OPT_PRINT_PASSWORD_LINE,
"Prepare an entry for the password file and exit.", "Print out a user entry as a line for the password file and exit.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "password", OPT_PASSWORD, "Password to update the password file", { "password", OPT_PASSWORD, "Password to update the password file",
...@@ -339,7 +339,7 @@ get_one_option(int optid, ...@@ -339,7 +339,7 @@ get_one_option(int optid,
case 'V': case 'V':
version(); version();
exit(0); exit(0);
case OPT_PASSWD: case OPT_PRINT_PASSWORD_LINE:
case OPT_ADD_USER: case OPT_ADD_USER:
case OPT_DROP_USER: case OPT_DROP_USER:
case OPT_EDIT_USER: case OPT_EDIT_USER:
...@@ -354,8 +354,8 @@ get_one_option(int optid, ...@@ -354,8 +354,8 @@ get_one_option(int optid,
} }
switch (optid) { switch (optid) {
case OPT_PASSWD: case OPT_PRINT_PASSWORD_LINE:
Options::User_management::cmd= new Passwd_cmd(); Options::User_management::cmd= new Print_password_line_cmd();
break; break;
case OPT_ADD_USER: case OPT_ADD_USER:
Options::User_management::cmd= new Add_user_cmd(); Options::User_management::cmd= new Add_user_cmd();
......
...@@ -180,10 +180,10 @@ static int save_password_file(User_map *user_map) ...@@ -180,10 +180,10 @@ static int save_password_file(User_map *user_map)
} }
/************************************************************************* /*************************************************************************
Passwd_cmd Print_password_line_cmd
*************************************************************************/ *************************************************************************/
int Passwd_cmd::execute() int Print_password_line_cmd::execute()
{ {
LEX_STRING user_name; LEX_STRING user_name;
const char *password; const char *password;
......
...@@ -61,13 +61,14 @@ class User_management_cmd ...@@ -61,13 +61,14 @@ class User_management_cmd
/************************************************************************* /*************************************************************************
Passwd_cmd: support for --passwd command-line option. Print_password_line_cmd: support for --print-password-line command-line
option.
*************************************************************************/ *************************************************************************/
class Passwd_cmd : public User_management_cmd class Print_password_line_cmd : public User_management_cmd
{ {
public: public:
Passwd_cmd() Print_password_line_cmd()
{ } { }
public: public:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment