X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FcommandLine.inc;h=206e04677b4a46cab494cb3d42d2caeb565e8b5e;hb=1326bfc813fc789935088bea572f11cca83ce8d5;hp=be07142208628aca43035ce0052173608785db8e;hpb=59183f670a9e60975632414b25b05f16edf06485;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/commandLine.inc b/maintenance/commandLine.inc index be07142208..206e04677b 100644 --- a/maintenance/commandLine.inc +++ b/maintenance/commandLine.inc @@ -23,22 +23,34 @@ 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() { - global $optionsWithArgs; + // @codingStandardsIgnoreStart MediaWiki.NamingConventions.ValidGlobalName.wgPrefix + 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 ) { @@ -48,7 +60,9 @@ class CommandLineInc extends Maintenance { } public function execute() { + // @codingStandardsIgnoreStart MediaWiki.NamingConventions.ValidGlobalName.wgPrefix global $args, $options; + // @codingStandardsIgnoreEnd $args = $this->mArgs; $options = $this->mOptions; } @@ -56,4 +70,3 @@ class CommandLineInc extends Maintenance { $maintClass = 'CommandLineInc'; require RUN_MAINTENANCE_IF_MAIN; -