@@ -32,7 +32,7 @@ require_once __DIR__ . '/../vendor/autoload.php';
3232 ->addOption ('inputDir ' , 'i ' , InputOption::VALUE_REQUIRED , 'Directory containing the files to annotate ' , '. ' )
3333 ->addOption ('linkPrefix ' , 'l ' , InputOption::VALUE_REQUIRED , 'Prefix for links in the output ' )
3434 ->addOption ('mixAnnotationsIntoSource ' , 'm ' , InputOption::VALUE_NONE , 'Include all Lua source files, and add class annotations to the source files ' )
35- ->addOption ('includeRawXmlSource ' , 'x ' , InputOption::VALUE_NONE , 'Include the raw XML source files in the output ' )
35+ ->addOption ('includeRawXmlSource ' , 'x ' , InputOption::VALUE_NONE , 'Include the raw XML and TOC source files in the output ' )
3636 ->setCode (function (InputInterface $ input , ConsoleOutput $ output ) {
3737 $ io = new SymfonyStyle ($ input , $ output );
3838
@@ -78,7 +78,7 @@ require_once __DIR__ . '/../vendor/autoload.php';
7878 foreach (array_keys ($ dirsWithToc ) as $ dirWithToc ) {
7979 $ tocFile = $ tocParser ->findTocFile ($ dirWithToc );
8080 if ($ tocFile ) {
81- $ fileList = array_merge ($ fileList , $ tocParser ->listFiles ($ tocFile ));
81+ $ fileList = array_merge ($ fileList , $ tocParser ->listFiles ($ tocFile ), [ $ tocFile ] );
8282 }
8383 }
8484 }
@@ -112,6 +112,8 @@ require_once __DIR__ . '/../vendor/autoload.php';
112112 }
113113 } elseif (str_ends_with ($ filePath , 'lua ' )) {
114114 $ luaFileParser ->writeAnnotationsToFile ($ filePath , $ outputDir , $ inputDir );
115+ } elseif (isset ($ tocParser ) && $ includeRawXmlSource && str_ends_with ($ filePath , 'toc ' )) {
116+ $ tocParser ->writeRawTocToFile ($ filePath , $ outputDir , $ inputDir );
115117 }
116118 $ progressBar ->advance ();
117119 }
0 commit comments