Fix regression in r52174 where parameter was not passed to MediaWiki:sp-contributions...
[lhc/web/wiklou.git] / maintenance / edit.php
index 704909a..8d0068c 100644 (file)
@@ -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 );