X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FcommandLine.inc;h=bb1443f6ebec2b531fc14e12fde3ca03be756a63;hb=2adcdd395b2a39b1afe1fa4631febf2da0d397ae;hp=8232d529470aa2a238181287dc903231c0b164ba;hpb=577f3d79115173f4dd16bb46f6d0ef2c82b55add;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 ); } /**