#!/usr/bin/env php addDescription( "This script checks if the input is valid texvc." . "For valid input, it returns a normalized texvc string, " . "otherwise the error code and detail are shown." ); $this->addArg( 'input', 'The tex input to be checked', true ); $this->requireExtension( 'Math' ); } /** * @throws Exception */ public function execute() { $userInputTex = $this->getArg( 0 ); $texvc = new MediaWiki\Extension\Math\TexVC\TexVC(); $result = $texvc->check( $userInputTex ); if ( $result['status'] !== '+' ) { $this->error( $result['status'] . $result['details'] ); } $this->output( $result['output'] ); $this->output( "\n" ); } } $maintClass = TexVcCli::class; /** @noinspection PhpIncludeInspection */ require_once RUN_MAINTENANCE_IF_MAIN;