From 64bbb42553c925ebf7177945d048c18675188584 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 22 Mar 2025 23:17:52 +0100 Subject: Fix CLI flag parsing (#7430) * Fix CLI flag parsing fix https://github.com/FreshRSS/FreshRSS/issues/7428 * Fix other places * Forgotten debugging --- cli/manipulate.translation.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'cli/manipulate.translation.php') diff --git a/cli/manipulate.translation.php b/cli/manipulate.translation.php index 061af8c15..434fb61a5 100755 --- a/cli/manipulate.translation.php +++ b/cli/manipulate.translation.php @@ -12,8 +12,8 @@ $cliOptions = new class extends CliOptionsParser { public string $value; public string $language; public string $originLanguage; - public string $revert; - public string $help; + public bool $revert; + public bool $help; public function __construct() { $this->addRequiredOption('action', (new CliOption('action', 'a'))); @@ -30,7 +30,7 @@ $cliOptions = new class extends CliOptionsParser { if (!empty($cliOptions->errors)) { fail('FreshRSS error: ' . array_shift($cliOptions->errors) . "\n" . $cliOptions->usage); } -if (isset($cliOptions->help)) { +if ($cliOptions->help) { manipulateHelp(); } @@ -79,7 +79,7 @@ switch ($cliOptions->action) { break; case 'ignore': if (isset($cliOptions->language) && isset($cliOptions->key)) { - $i18nData->ignore($cliOptions->key, $cliOptions->language, isset($cliOptions->revert)); + $i18nData->ignore($cliOptions->key, $cliOptions->language, $cliOptions->revert); } else { error('You need to specify a valid set of options.'); exit; @@ -87,7 +87,7 @@ switch ($cliOptions->action) { break; case 'ignore_unmodified': if (isset($cliOptions->language)) { - $i18nData->ignore_unmodified($cliOptions->language, isset($cliOptions->revert)); + $i18nData->ignore_unmodified($cliOptions->language, $cliOptions->revert); } else { error('You need to specify a valid set of options.'); exit; -- cgit v1.2.3