chg: [CLI] better error messages when a setting change fails

- explain why it failed
- explain how a user can override it
pull/7600/head
iglocska 2021-07-26 10:23:57 +02:00
parent 4455d1b1b4
commit 567bcdc1ca
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 4 additions and 2 deletions

View File

@ -350,7 +350,9 @@ class AdminShell extends AppShell
if ($result === true) {
echo 'Setting "' . $setting_name . '" changed to ' . $value . PHP_EOL;
} else {
echo $result;
$message = __("The setting change was rejected. MISP considers the requested setting value as invalid and would lead to the following error:\n\n\"%s\"\n\nIf you still want to force this change, please supply the --force argument.\n", $result);
Shell::error(__('Setting change rejected.'), $message);
die();
}
}
echo PHP_EOL;
@ -490,7 +492,7 @@ class AdminShell extends AppShell
{
$this->ConfigLoad->execute();
$parser = parent::getOptionParser();
$parser->addSubcommand('updateJSON', array(
'help' => __('Update the JSON definitions of MISP.'),
'parser' => array(