r86067 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86066‎ | r86067 | r86068 >
Date:19:01, 14 April 2011
Author:ialex
Status:ok
Tags:
Comment:
Update undelete.php to use short option aliases.
People using --u and --r will need to change either to -u or --user for --u and to -r or --reason for --r.
Modified paths:
  • /trunk/phase3/maintenance/undelete.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/undelete.php
@@ -27,16 +27,16 @@
2828 public function __construct() {
2929 parent::__construct();
3030 $this->mDescription = "Undelete a page";
31 - $this->addOption( 'u', 'The user to perform the undeletion', false, true );
32 - $this->addOption( 'r', 'The reason to undelete', false, true );
 31+ $this->addOption( 'user', 'The user to perform the undeletion', false, true, 'u' );
 32+ $this->addOption( 'reason', 'The reason to undelete', false, true, 'r' );
3333 $this->addArg( 'pagename', 'Page to undelete' );
3434 }
3535
3636 public function execute() {
3737 global $wgUser;
3838
39 - $user = $this->getOption( 'u', 'Command line script' );
40 - $reason = $this->getOption( 'r', '' );
 39+ $user = $this->getOption( 'user', 'Command line script' );
 40+ $reason = $this->getOption( 'reason', '' );
4141 $pageName = $this->getArg();
4242
4343 $title = Title::newFromText( $pageName );

Status & tagging log