diff options
| author | 2025-03-22 23:17:52 +0100 | |
|---|---|---|
| committer | 2025-03-22 23:17:52 +0100 | |
| commit | 64bbb42553c925ebf7177945d048c18675188584 (patch) | |
| tree | e9f11e54b44512628304bcd83a1f6f418529099f /cli/import-sqlite-for-user.php | |
| parent | 72ad6e528cc7d65d4d4f401a705cd9e2e6183c1a (diff) | |
Fix CLI flag parsing (#7430)
* Fix CLI flag parsing
fix https://github.com/FreshRSS/FreshRSS/issues/7428
* Fix other places
* Forgotten debugging
Diffstat (limited to 'cli/import-sqlite-for-user.php')
| -rwxr-xr-x | cli/import-sqlite-for-user.php | 5 |
1 files changed, 2 insertions, 3 deletions
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"; } |
