aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance
diff options
context:
space:
mode:
authorSubramanya Sastry <ssastry@wikimedia.org>2017-03-12 17:13:51 -0500
committerTim Starling <tstarling@wikimedia.org>2017-03-15 09:49:02 +1100
commitab68d05cc4330c7cd6fea565bf5ad96beff7e00f (patch)
tree5c3d4cd2e1e63bf0af1b5fa1b3c0245301554a03 /maintenance
parentdc35b44b204efd9e96d2371ca22a73a9efdc723b (diff)
downloadmediawikicore-ab68d05cc4330c7cd6fea565bf5ad96beff7e00f.tar.gz
mediawikicore-ab68d05cc4330c7cd6fea565bf5ad96beff7e00f.zip
Add --tidy option to maintenance/parse.php
Change-Id: I6ec08237bd15ee2d824164a0493b7fff9ef312db
Diffstat (limited to 'maintenance')
-rw-r--r--maintenance/parse.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/maintenance/parse.php b/maintenance/parse.php
index 17a8d2ebf4f0..6279a348ac7d 100644
--- a/maintenance/parse.php
+++ b/maintenance/parse.php
@@ -68,6 +68,7 @@ class CLIParser extends Maintenance {
false,
true
);
+ $this->addOption( 'tidy', 'Tidy the output' );
$this->addArg( 'file', 'File containing wikitext (Default: stdin)', false );
}
@@ -127,10 +128,14 @@ class CLIParser extends Maintenance {
* @return ParserOutput
*/
protected function parse( $wikitext ) {
+ $options = new ParserOptions;
+ if ( $this->getOption( 'tidy' ) ) {
+ $options->setTidy( true );
+ }
return $this->parser->parse(
$wikitext,
$this->getTitle(),
- new ParserOptions()
+ $options
);
}
}