From: Timo Tijhof Date: Fri, 15 Mar 2013 06:10:04 +0000 (+0100) Subject: mwdocgen.php: Implement --version option. X-Git-Tag: 1.31.0-rc.0~20337 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=0d76bceabd9ed9dadc249d59ef78a2cc4bc4f82d;p=lhc%2Fweb%2Fwiklou.git mwdocgen.php: Implement --version option. So that the job that runs it can pass along what it should display (e.g. branch, tag, hash etc. whatever is appropiate for the context of that run). Change-Id: I1d5b6266e49a71672b0a53069e6ea6bb4658c3d2 --- diff --git a/maintenance/mwdocgen.php b/maintenance/mwdocgen.php index 5e505eba57..756db6cf50 100644 --- a/maintenance/mwdocgen.php +++ b/maintenance/mwdocgen.php @@ -63,6 +63,8 @@ $doxygenInputFilter = "php {$mwPath}maintenance/mwdoc-filter.php"; /** where Phpdoc should output documentation */ $doxyOutput = $mwPath . 'docs' . DIRECTORY_SEPARATOR ; +$doxyVersion = 'master'; + /** MediaWiki subpaths */ $mwPathI = $mwPath . 'includes/'; $mwPathL = $mwPath . 'languages/'; @@ -164,6 +166,12 @@ if ( is_array( $argv ) ) { $doxyOutput = realpath( $argv[$i] ); } break; + case '--version': + $i++; + if ( isset( $argv[$i] ) ) { + $doxyVersion = $argv[$i]; + } + break; case '--generate-man': $doxyGenerateMan = true; break; @@ -183,8 +191,9 @@ Commands: If no command is given, you will be prompted. Other options: - --output Set output directory (default $doxyOutput) + --output Set output directory (default: $doxyOutput) --generate-man Generates man page documentation + --version Project version to display in the outut (default: $doxyVersion) --help Show this help and exit. @@ -234,14 +243,11 @@ case 6: $excludePatterns = 'extensions'; } -// @todo FIXME to work on git -$version = 'master'; - // Generate path exclusions $excludedPaths = $mwPath . join( " $mwPath", $mwExcludePaths ); print "EXCLUDE: $excludedPaths\n\n"; -$generatedConf = generateConfigFile( $doxygenTemplate, $doxyOutput, $mwPath, $version, $input, $excludedPaths, $excludePatterns, $doxyGenerateMan, $doxygenInputFilter ); +$generatedConf = generateConfigFile( $doxygenTemplate, $doxyOutput, $mwPath, $doxyVersion, $input, $excludedPaths, $excludePatterns, $doxyGenerateMan, $doxygenInputFilter ); $command = $doxygenBin . ' ' . $generatedConf; echo <<