X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Fedit.php;h=8d0068c34d98805373387916222580c2fd8fd36e;hb=17484e507dd9b9c6c4d182cea940980dabc7f787;hp=704909adf73123ce546a4cb1c24bb67ffe6c97cb;hpb=5ff7ffe312d2881725293deb994c863103923271;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/edit.php b/maintenance/edit.php index 704909adf7..8d0068c34d 100644 --- a/maintenance/edit.php +++ b/maintenance/edit.php @@ -20,7 +20,7 @@ * @ingroup Maintenance */ -require_once( "Maintenance.php" ); +require_once( dirname(__FILE__) . '/Maintenance.php' ); class EditCLI extends Maintenance { public function __construct() { @@ -32,7 +32,7 @@ class EditCLI extends Maintenance { $this->addOption( 'b', 'Bot edit' ); $this->addOption( 'a', 'Enable autosummary' ); $this->addOption( 'no-rc', 'Do not show the change in recent changes' ); - $this->addArgs( array( 'title' ) ); + $this->addArg( 'title', 'Title of article to edit' ); } public function execute() { @@ -47,7 +47,7 @@ class EditCLI extends Maintenance { $wgUser = User::newFromName( $userName ); if ( !$wgUser ) { - $this->error( "Invalid username\n", true ); + $this->error( "Invalid username", true ); } if ( $wgUser->isAnon() ) { $wgUser->addToDatabase(); @@ -55,7 +55,7 @@ class EditCLI extends Maintenance { $wgTitle = Title::newFromText( $this->getArg() ); if ( !$wgTitle ) { - $this->error( "Invalid title\n", true ); + $this->error( "Invalid title", true ); } $wgArticle = new Article( $wgTitle );