Index: trunk/phase3/maintenance/mwdocgen.php |
— | — | @@ -180,20 +180,51 @@ |
181 | 181 | |
182 | 182 | unset( $file ); |
183 | 183 | |
184 | | -if ( is_array( $argv ) && isset( $argv[1] ) ) { |
185 | | - switch( $argv[1] ) { |
186 | | - case '--all': $input = 0; break; |
187 | | - case '--includes': $input = 1; break; |
188 | | - case '--languages': $input = 2; break; |
189 | | - case '--maintenance': $input = 3; break; |
190 | | - case '--skins': $input = 4; break; |
191 | | - case '--file': |
192 | | - $input = 5; |
193 | | - if ( isset( $argv[2] ) ) { |
194 | | - $file = $argv[2]; |
| 184 | +if ( is_array( $argv ) ) { |
| 185 | + for ($i = 0; $i < count($argv); $i++ ) { |
| 186 | + switch( $argv[$i] ) { |
| 187 | + case '--all': $input = 0; break; |
| 188 | + case '--includes': $input = 1; break; |
| 189 | + case '--languages': $input = 2; break; |
| 190 | + case '--maintenance': $input = 3; break; |
| 191 | + case '--skins': $input = 4; break; |
| 192 | + case '--file': |
| 193 | + $input = 5; |
| 194 | + $i++; |
| 195 | + if ( isset( $argv[$i] ) ) { |
| 196 | + $file = $argv[$i]; |
| 197 | + } |
| 198 | + break; |
| 199 | + case '--no-extensions': $input = 6; break; |
| 200 | + case '--output': |
| 201 | + $i++; |
| 202 | + if ( isset( $argv[$i] ) ) { |
| 203 | + $doxyOutput = realpath( $argv[$i] ); |
| 204 | + } |
| 205 | + break; |
| 206 | + case '--help': |
| 207 | + print <<<END |
| 208 | +Usage: php mwdocgen.php [<command>] [<options>] |
| 209 | + |
| 210 | +Commands: |
| 211 | + --all Process entire codebase |
| 212 | + --includes Process only files in includes/ dir |
| 213 | + --languages Process only files in languages/ dir |
| 214 | + --maintenance Process only files in maintenance/ dir |
| 215 | + --skins Process only files in skins/ dir |
| 216 | + --file <file> Process only the given file |
| 217 | + |
| 218 | +If no command is given, you will be prompted. |
| 219 | + |
| 220 | +Other options: |
| 221 | + --output <dir> Set output directory (default $doxyOutput) |
| 222 | + --help Show this help and exit. |
| 223 | + |
| 224 | + |
| 225 | +END; |
| 226 | + exit(0); |
| 227 | + break; |
195 | 228 | } |
196 | | - break; |
197 | | - case '--no-extensions': $input = 6; break; |
198 | 229 | } |
199 | 230 | } |
200 | 231 | |