Index: trunk/phase3/maintenance/Maintenance.php |
— | — | @@ -248,6 +248,20 @@ |
249 | 249 | */ |
250 | 250 | protected function setBatchSize( $s = 0 ) { |
251 | 251 | $this->mBatchSize = $s; |
| 252 | + |
| 253 | + // If we support $mBatchSize, show the option. |
| 254 | + // Used to be in addDefaultParams, but in order for that to |
| 255 | + // work, subclasses would have to call this function in the constructor |
| 256 | + // before they called parent::__construct which is just weird |
| 257 | + // (and really wasn't done). |
| 258 | + if ( $this->mBatchSize ) { |
| 259 | + $this->addOption( 'batch-size', 'Run this many operations ' . |
| 260 | + 'per batch, default: ' . $this->mBatchSize, false, true ); |
| 261 | + if ( isset( $this->mParams['batch-size'] ) ) { |
| 262 | + // This seems a little ugly... |
| 263 | + $this->mDependantParameters['batch-size'] = $this->mParams['batch-size']; |
| 264 | + } |
| 265 | + } |
252 | 266 | } |
253 | 267 | |
254 | 268 | /** |
— | — | @@ -418,11 +432,7 @@ |
419 | 433 | $this->addOption( 'dbuser', 'The DB user to use for this script', false, true ); |
420 | 434 | $this->addOption( 'dbpass', 'The password to use for this script', false, true ); |
421 | 435 | } |
422 | | - // If we support $mBatchSize, show the option |
423 | | - if ( $this->mBatchSize ) { |
424 | | - $this->addOption( 'batch-size', 'Run this many operations ' . |
425 | | - 'per batch, default: ' . $this->mBatchSize, false, true ); |
426 | | - } |
| 436 | + |
427 | 437 | # Save additional script dependant options to display |
428 | 438 | # them separately in help |
429 | 439 | $this->mDependantParameters = array_diff_key( $this->mParams, $this->mGenericParameters ); |
Index: trunk/phase3/RELEASE-NOTES-1.19 |
— | — | @@ -72,6 +72,7 @@ |
73 | 73 | used |
74 | 74 | * (bug 28649) Avoiding half truncated multi-byte unicode characters when |
75 | 75 | truncating log comments. |
| 76 | +* Show --batch-size option in help of maintenance scripts that support it |
76 | 77 | |
77 | 78 | === API changes in 1.19 === |
78 | 79 | * (bug 19838) siprop=interwikimap can now use the interwiki cache. |