X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FcommandLine.inc;h=206e04677b4a46cab494cb3d42d2caeb565e8b5e;hb=7ade0a7c678ffa4233728683a91c2aeab0c8d344;hp=0d3e643234a867a2e4124a5a1d5a4ea991ece0e9;hpb=13e33c28983461d5b8bdc1dece0cd0a35347a261;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/commandLine.inc b/maintenance/commandLine.inc index 0d3e643234..206e04677b 100644 --- a/maintenance/commandLine.inc +++ b/maintenance/commandLine.inc @@ -25,24 +25,32 @@ require_once __DIR__ . '/Maintenance.php'; // @codingStandardsIgnoreStart MediaWiki.NamingConventions.ValidGlobalName.wgPrefix global $optionsWithArgs; +global $optionsWithoutArgs; // @codingStandardsIgnoreEnd if ( !isset( $optionsWithArgs ) ) { - $optionsWithArgs = array(); + $optionsWithArgs = []; +} +if ( !isset( $optionsWithoutArgs ) ) { + $optionsWithoutArgs = []; } class CommandLineInc extends Maintenance { public function __construct() { // @codingStandardsIgnoreStart MediaWiki.NamingConventions.ValidGlobalName.wgPrefix - global $optionsWithArgs; + global $optionsWithArgs, $optionsWithoutArgs; // @codingStandardsIgnoreEnd parent::__construct(); foreach ( $optionsWithArgs as $name ) { $this->addOption( $name, '', false, true ); } + foreach ( $optionsWithoutArgs as $name ) { + $this->addOption( $name, '', false, false ); + } } /** * No help, it would just be misleading since it misses custom options + * @param bool $force */ protected function maybeHelp( $force = false ) { if ( !$force ) { @@ -62,4 +70,3 @@ class CommandLineInc extends Maintenance { $maintClass = 'CommandLineInc'; require RUN_MAINTENANCE_IF_MAIN; -