aboutsummaryrefslogtreecommitdiff
path: root/cli/_update-or-create-user.php
diff options
context:
space:
mode:
authorGravatar Alexis Degrugillier <aledeg@users.noreply.github.com> 2019-03-19 20:27:06 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2019-03-19 20:27:06 +0100
commit71b4226dc721bc0f23cc594760329f29e51defac (patch)
tree7a90f25cd21e882b64cd6ed31f646226d80307b3 /cli/_update-or-create-user.php
parent834ffacce22ff6a2c0f1459476dc4a45e8ea06f9 (diff)
Add an option validation on cli commands (#2278)
If an option used on cli is not recognized, the command aborts and displays an error message. If the typed option is similar to one of the recognized options, a hint is displayed. At the moment, there is a limitation on long options. Short options are not validated at the moment. See #2046
Diffstat (limited to 'cli/_update-or-create-user.php')
-rw-r--r--cli/_update-or-create-user.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/cli/_update-or-create-user.php b/cli/_update-or-create-user.php
index a5960b58a..eda597f19 100644
--- a/cli/_update-or-create-user.php
+++ b/cli/_update-or-create-user.php
@@ -22,7 +22,7 @@ if (!$isUpdate) {
$options = getopt('', $params);
-if (empty($options['user'])) {
+if (!validateOptions($argv, $params) || empty($options['user'])) {
fail('Usage: ' . basename($_SERVER['SCRIPT_FILENAME']) .
" --user username ( --password 'password' --api_password 'api_password'" .
" --language en --email user@example.net --token 'longRandomString'" .