Add @deprecated tags to DatabaseBase
[lhc/web/wiklou.git] / maintenance / parse.php
index 17a8d2e..cf2fe54 100644 (file)
@@ -46,7 +46,7 @@
  * @file
  * @ingroup Maintenance
  * @author Antoine Musso <hashar at free dot fr>
- * @license GNU General Public License 2.0 or later
+ * @license GPL-2.0-or-later
  */
 
 require_once __DIR__ . '/Maintenance.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,13 +128,17 @@ 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
                );
        }
 }
 
-$maintClass = "CLIParser";
+$maintClass = CLIParser::class;
 require_once RUN_MAINTENANCE_IF_MAIN;