From 5033691c4ab70d426f9ea273cc55fade873f20fc Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sat, 20 Nov 2010 11:11:20 +0000 Subject: [PATCH] * (bug 26023) Corrected deleteBacth.php's documentation --- RELEASE-NOTES | 1 + maintenance/Maintenance.php | 14 ++++++++++---- maintenance/deleteBatch.php | 3 ++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 3cd04ed7da..80afa03e2d 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -432,6 +432,7 @@ LocalSettings.php. The specific bugs are listed below in the general notes. * (bug 20591) There's now a different message on Special:MovePage when $wgFixDoubleRedirects is set to false. * Fixed PHP warnings when updating a broken MySQL database. +* (bug 26023) Corrected deleteBacth.php's documentation === API changes in 1.17 === * (bug 22738) Allow filtering by action type on query=logevent. diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index 19c6a3cf41..b43742fdb6 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -673,11 +673,15 @@ abstract class Maintenance { // ... and append arguments. if ( $this->mArgList ) { - $output .= " <"; + $output .= ' '; foreach ( $this->mArgList as $k => $arg ) { - $output .= $arg['name'] . ">"; + if ( $arg['require'] ) { + $output .= '<' . $arg['name'] . '>'; + } else { + $output .= '[' . $arg['name'] . ']'; + } if ( $k < count( $this->mArgList ) - 1 ) - $output .= " <"; + $output .= ' '; } } $this->output( "$output\n\n" ); @@ -692,8 +696,10 @@ abstract class Maintenance { // Arguments description foreach ( $this->mArgList as $info ) { + $openChar = $info['require'] ? '<' : '['; + $closeChar = $info['require'] ? '>' : ']'; $this->output( - wordwrap( "$tab<" . $info['name'] . ">: " . + wordwrap( "$tab$openChar" . $info['name'] . "$closeChar: " . $info['desc'], $descWidth, "\n$tab$tab" ) . "\n" ); } diff --git a/maintenance/deleteBatch.php b/maintenance/deleteBatch.php index 120ed7e207..9571bdec1e 100644 --- a/maintenance/deleteBatch.php +++ b/maintenance/deleteBatch.php @@ -37,7 +37,8 @@ class DeleteBatch extends Maintenance { $this->addOption( 'u', "User to perform deletion", false, true ); $this->addOption( 'r', "Reason to delete page", false, true ); $this->addOption( 'i', "Interval to sleep between deletions" ); - $this->addArg( 'listfile', 'File with titles to delete, separated by newlines', false ); + $this->addArg( 'listfile', 'File with titles to delete, separated by newlines. ' . + 'If not given, stdin will be used.', false ); } public function execute() { -- 2.20.1