addDescription( 'Adds a change tag to the wiki.' ); $this->addOption( 'tag', 'Tag to add', true, true ); $this->addOption( 'reason', 'Reason for adding the tag', true, true ); } public function execute() { $user = User::newSystemUser( 'Maintenance script', [ 'steal' => true ] ); $tag = $this->getOption( 'tag' ); $status = ChangeTags::createTagWithChecks( $tag, $this->getOption( 'reason' ), $user ); if ( !$status->isGood() ) { $this->fatalError( $status->getMessage( false, false, 'en' )->text() ); } $this->output( "$tag was created.\n" ); } } $maintClass = AddChangeTag::class; require_once RUN_MAINTENANCE_IF_MAIN;