From 71b4226dc721bc0f23cc594760329f29e51defac Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Tue, 19 Mar 2019 20:27:06 +0100 Subject: 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 --- cli/do-install.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cli/do-install.php') diff --git a/cli/do-install.php b/cli/do-install.php index 7435ab9f1..fd5aa4a3c 100755 --- a/cli/do-install.php +++ b/cli/do-install.php @@ -31,10 +31,10 @@ $dBparams = array( $options = getopt('', array_merge($params, $dBparams)); -if (empty($options['default_user'])) { +if (!validateOptions($argv, array_merge($params, $dBparams)) || empty($options['default_user'])) { fail('Usage: ' . basename(__FILE__) . " --default_user admin ( --auth_type form" . - " --environment production --base_url https://rss.example.net" . - " --language en --title FreshRSS --allow_anonymous --api_enabled" . + " --environment production --base_url https://rss.example.net --allow_robots" . + " --language en --title FreshRSS --allow_anonymous --allow_anonymous_refresh --api_enabled" . " --db-type mysql --db-host localhost:3306 --db-user freshrss --db-password dbPassword123" . " --db-base freshrss --db-prefix freshrss_ --disable_update )"); } -- cgit v1.2.3