From 11624828bdea7d5e1536afacc7c567a4b9aeb38a Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Thu, 30 May 2013 20:41:27 +0200 Subject: [PATCH] mwdocgen: support multiple --file values It is sometimes useful to generate documentation for multiple files or directories. Doxygen INPUT statement supports multiple space separated paths. Example usage: php maintenance/mwdocgen.php --file docs,input Change-Id: I66a805d80307c6502e9b440df63a37bb13093d84 --- maintenance/mwdocgen.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/maintenance/mwdocgen.php b/maintenance/mwdocgen.php index 1ca0b5422c..9fb1314228 100644 --- a/maintenance/mwdocgen.php +++ b/maintenance/mwdocgen.php @@ -57,7 +57,8 @@ class MWDocGen extends Maintenance { $this->addOption( 'generate-man', 'Whether to generate man files' ); $this->addOption( 'file', - 'Only process given file (relative to $IP)', + "Only process given file or directory. Multiple values " . + "accepted with comma separation. Path relative to \$IP.", false, true ); $this->addOption( 'output', 'Path to write doc to', @@ -75,7 +76,14 @@ class MWDocGen extends Maintenance { $this->doxygen = $this->getOption( 'doxygen', 'doxygen' ); $this->mwVersion = $this->getOption( 'version', 'master' ); - $this->input = $IP . '/' . $this->getOption( 'file', '' ); + + $this->input = ''; + $inputs = explode( ',', $this->getOption( 'file', '' ) ); + foreach( $inputs as $input ) { + # Doxygen inputs are space separted and double quoted + $this->input .= " \"$IP/$input\""; + } + $this->output = $this->getOption( 'output', "$IP/docs" ); $this->inputFilter = wfShellWikiCmd( -- 2.20.1