Convert comments in a --help option
authorAntoine Musso <hashar@users.mediawiki.org>
Mon, 14 May 2007 20:42:19 +0000 (20:42 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Mon, 14 May 2007 20:42:19 +0000 (20:42 +0000)
maintenance/dumpHTML.php

index b9b052e..f1d3964 100644 (file)
@@ -4,33 +4,38 @@
  * @addtogroup Maintenance
  */
 
-/**
- * Usage:
- * php dumpHTML.php [options...]
- *
- * -d <dest>            destination directory
- * -s <start>           start ID
- * -e <end>             end ID
- * -k <skin>            skin to use (defaults to htmldump)
- * --no-overwrite       skip existing HTML files
- * --checkpoint <file>  use a checkpoint file to allow restarting of interrupted dumps
- * --slice <n/m>        split the job into m segments and do the n'th one
- * --images             only do image description pages
- * --shared-desc        only do shared (commons) image description pages
- * --no-shared-desc     don't do shared image description pages
- * --categories         only do category pages
- * --redirects          only do redirects
- * --special            only do miscellaneous stuff
- * --force-copy         copy commons instead of symlink, needed for Wikimedia
- * --interlang          allow interlanguage links
- * --image-snapshot     copy all images used to the destination directory
- * --compress           generate compressed version of the html pages
- * --udp-profile <N>    profile 1/N rendering operations using ProfilerSimpleUDP
- */
-
+function ShowUsage() {
+echo <<<END
+Usage:
+php dumpHTML.php --help
+php dumpHTML.php [options...]
+
+       --help               show this message
+
+       -d <dest>            destination directory
+       -s <start>           start ID
+       -e <end>             end ID
+       -k <skin>            skin to use (defaults to htmldump)
+       --no-overwrite       skip existing HTML files
+       --checkpoint <file>  use a checkpoint file to allow restarting of interrupted dumps
+       --slice <n/m>        split the job into m segments and do the n'th one
+       --images             only do image description pages
+       --shared-desc        only do shared (commons) image description pages
+       --no-shared-desc     don't do shared image description pages
+       --categories         only do category pages
+       --redirects          only do redirects
+       --special            only do miscellaneous stuff
+       --force-copy         copy commons instead of symlink, needed for Wikimedia
+       --interlang          allow interlanguage links
+       --image-snapshot     copy all images used to the destination directory
+       --compress           generate compressed version of the html pages
+       --udp-profile <N>    profile 1/N rendering operations using ProfilerSimpleUDP
+
+END;
+}
 
 $optionsWithArgs = array( 's', 'd', 'e', 'k', 'checkpoint', 'slice', 'udp-profile' );
-
+$options = array( 'help' );
 $profiling = false;
 
 if ( $profiling ) {
@@ -52,6 +57,11 @@ require_once( "dumpHTML.inc" );
 
 error_reporting( E_ALL & (~E_NOTICE) );
 
+if( isset( $options['help'] ) ) {
+       ShowUsage();
+       exit();
+}
+
 if ( !empty( $options['s'] ) ) {
        $start = $options['s'];
 } else {