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/import-sqlite-for-user.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'cli/import-sqlite-for-user.php') diff --git a/cli/import-sqlite-for-user.php b/cli/import-sqlite-for-user.php index 45ecb3597..2eb3e2965 100755 --- a/cli/import-sqlite-for-user.php +++ b/cli/import-sqlite-for-user.php @@ -8,7 +8,7 @@ performRequirementCheck(FreshRSS_Context::systemConf()->db['type'] ?? ''); $cliOptions = new class extends CliOptionsParser { public string $user; public string $filename; - public string $forceOverwrite; + public bool $forceOverwrite; public function __construct() { $this->addRequiredOption('user', (new CliOption('user'))); @@ -32,8 +32,7 @@ if (pathinfo($filename, PATHINFO_EXTENSION) !== 'sqlite') { echo 'FreshRSS importing database from SQLite for user “', $username, "”…\n"; $databaseDAO = FreshRSS_Factory::createDatabaseDAO($username); -$clearFirst = isset($cliOptions->forceOverwrite); -$ok = $databaseDAO->dbCopy($filename, FreshRSS_DatabaseDAO::SQLITE_IMPORT, $clearFirst); +$ok = $databaseDAO->dbCopy($filename, FreshRSS_DatabaseDAO::SQLITE_IMPORT, clearFirst: $cliOptions->forceOverwrite); if (!$ok) { echo 'If you would like to clear the user database first, use the option --force-overwrite', "\n"; } -- cgit v1.2.3