@@ -75,11 +75,21 @@ protected function execute(InputInterface $input, OutputInterface $output)
75
75
public function getOptionsList ()
76
76
{
77
77
return [
78
- new InputOption (AdminAccount::KEY_USER , null , InputOption::VALUE_REQUIRED , 'Admin user ' ),
79
- new InputOption (AdminAccount::KEY_PASSWORD , null , InputOption::VALUE_REQUIRED , 'Admin password ' , '' ),
80
- new InputOption (AdminAccount::KEY_EMAIL , null , InputOption::VALUE_REQUIRED , 'Admin email ' ),
81
- new InputOption (AdminAccount::KEY_FIRST_NAME , null , InputOption::VALUE_REQUIRED , 'Admin first name ' ),
82
- new InputOption (AdminAccount::KEY_LAST_NAME , null , InputOption::VALUE_REQUIRED , 'Admin last name ' ),
78
+ new InputOption (AdminAccount::KEY_USER , null , InputOption::VALUE_REQUIRED , '(Required) Admin user ' ),
79
+ new InputOption (AdminAccount::KEY_PASSWORD , null , InputOption::VALUE_REQUIRED , '(Required) Admin password ' ),
80
+ new InputOption (AdminAccount::KEY_EMAIL , null , InputOption::VALUE_REQUIRED , '(Required) Admin email ' ),
81
+ new InputOption (
82
+ AdminAccount::KEY_FIRST_NAME ,
83
+ null ,
84
+ InputOption::VALUE_REQUIRED ,
85
+ '(Required) Admin first name '
86
+ ),
87
+ new InputOption (
88
+ AdminAccount::KEY_LAST_NAME ,
89
+ null ,
90
+ InputOption::VALUE_REQUIRED ,
91
+ '(Required) Admin last name '
92
+ ),
83
93
];
84
94
}
85
95
@@ -97,7 +107,10 @@ public function validate(InputInterface $input)
97
107
->setLastname ($ input ->getOption (AdminAccount::KEY_LAST_NAME ))
98
108
->setUsername ($ input ->getOption (AdminAccount::KEY_USER ))
99
109
->setEmail ($ input ->getOption (AdminAccount::KEY_EMAIL ))
100
- ->setPassword ($ input ->getOption (AdminAccount::KEY_PASSWORD ));
110
+ ->setPassword (
111
+ $ input ->getOption (AdminAccount::KEY_PASSWORD ) === null
112
+ ? '' : $ input ->getOption (AdminAccount::KEY_PASSWORD )
113
+ );
101
114
102
115
$ validator = new \Magento \Framework \Validator \Object ;
103
116
$ this ->validationRules ->addUserInfoRules ($ validator );
0 commit comments