Просмотр исходного кода

Fix: --db-prefix silently drops following CLI flags (#9042)

`--db-prefix` used to be defined with an optional value (`::`), but PHP's getopt() only accepts a value for an optional-value long option via `--db-prefix=value`, never the documented `--db-prefix value` form.

Passing it space-separated leaves the value as an unrecognized argument and silently drops every flag that follows (e.g. --disable_update) from getopt()'s result.

Revert to a somewhat required value (`:`), which still allows an empty prefix via `--db-prefix ''`.

Closes https://github.com/NixOS/nixpkgs/issues/530367

Changes proposed in this pull request:

- deprecate `--db-prefix=test_` (nowhere documented this way) and allow `--db-prefix test_`
Felix Bühler 13 часов назад
Родитель
Сommit
260f9078f7
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      cli/do-install.php
  2. 1 1
      cli/reconfigure.php

+ 1 - 1
cli/do-install.php

@@ -58,7 +58,7 @@ $cliOptions = new class extends CliOptionsParser {
 		$this->addOption('dbUser', (new CliOption('db-user')));
 		$this->addOption('dbPassword', (new CliOption('db-password')));
 		$this->addOption('dbBase', (new CliOption('db-base')));
-		$this->addOption('dbPrefix', (new CliOption('db-prefix'))->withValueOptional());
+		$this->addOption('dbPrefix', (new CliOption('db-prefix'))->withValueRequired());
 		parent::__construct();
 	}
 };

+ 1 - 1
cli/reconfigure.php

@@ -54,7 +54,7 @@ $cliOptions = new class extends CliOptionsParser {
 		$this->addOption('dbUser', (new CliOption('db-user')));
 		$this->addOption('dbPassword', (new CliOption('db-password')));
 		$this->addOption('dbBase', (new CliOption('db-base')));
-		$this->addOption('dbPrefix', (new CliOption('db-prefix'))->withValueOptional());
+		$this->addOption('dbPrefix', (new CliOption('db-prefix'))->withValueRequired());
 		parent::__construct();
 	}
 };