X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FcommandLine.inc;h=bb1443f6ebec2b531fc14e12fde3ca03be756a63;hb=a158a4fb32b57027f0dece321e4c18af4687454d;hp=8232d529470aa2a238181287dc903231c0b164ba;hpb=8a4a8a8dcbaf454c9f64cd8b5ba90704d7721500;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/commandLine.inc b/maintenance/commandLine.inc index 8232d52947..bb1443f6eb 100644 --- a/maintenance/commandLine.inc +++ b/maintenance/commandLine.inc @@ -24,7 +24,7 @@ require_once __DIR__ . '/Maintenance.php'; // phpcs:ignore MediaWiki.NamingConventions.ValidGlobalName.wgPrefix -global $optionsWithArgs, $optionsWithoutArgs; +global $optionsWithArgs, $optionsWithoutArgs, $allowUnregisteredOptions; if ( !isset( $optionsWithArgs ) ) { $optionsWithArgs = []; @@ -32,19 +32,25 @@ if ( !isset( $optionsWithArgs ) ) { if ( !isset( $optionsWithoutArgs ) ) { $optionsWithoutArgs = []; } +if ( !isset( $allowUnregisteredOptions ) ) { + $allowUnregisteredOptions = false; +} class CommandLineInc extends Maintenance { public function __construct() { // phpcs:ignore MediaWiki.NamingConventions.ValidGlobalName.wgPrefix - global $optionsWithArgs, $optionsWithoutArgs; + global $optionsWithArgs, $optionsWithoutArgs, $allowUnregisteredOptions; parent::__construct(); + foreach ( $optionsWithArgs as $name ) { $this->addOption( $name, '', false, true ); } foreach ( $optionsWithoutArgs as $name ) { $this->addOption( $name, '', false, false ); } + + $this->setAllowUnregisteredOptions( $allowUnregisteredOptions ); } /**