Index: branches/REL1_16/phase3/maintenance/Maintenance.php |
— | — | @@ -565,6 +565,10 @@ |
566 | 566 | * @param $force boolean Whether to force the help to show, default false |
567 | 567 | */ |
568 | 568 | protected function maybeHelp( $force = false ) { |
| 569 | + $screenWidth = 80; // TODO: Caculate this! |
| 570 | + $tab = " "; |
| 571 | + $descWidth = $screenWidth - ( 2 * strlen( $tab ) ); |
| 572 | + |
569 | 573 | ksort( $this->mParams ); |
570 | 574 | if( $this->hasOption( 'help' ) || $force ) { |
571 | 575 | $this->mQuiet = false; |
— | — | @@ -572,7 +576,7 @@ |
573 | 577 | if( $this->mDescription ) { |
574 | 578 | $this->output( "\n" . $this->mDescription . "\n" ); |
575 | 579 | } |
576 | | - $output = "\nUsage: php " . $this->mSelf; |
| 580 | + $output = "\nUsage: php " . basename( $this->mSelf ); |
577 | 581 | if( $this->mParams ) { |
578 | 582 | $output .= " [--" . implode( array_keys( $this->mParams ), "|--" ) . "]"; |
579 | 583 | } |
— | — | @@ -586,10 +590,12 @@ |
587 | 591 | } |
588 | 592 | $this->output( "$output\n" ); |
589 | 593 | foreach( $this->mParams as $par => $info ) { |
590 | | - $this->output( "\t$par : " . $info['desc'] . "\n" ); |
| 594 | + $this->output( wordwrap( "$tab$par : " . $info['desc'], $descWidth, |
| 595 | + "\n$tab$tab" ) . "\n" ); |
591 | 596 | } |
592 | 597 | foreach( $this->mArgList as $info ) { |
593 | | - $this->output( "\t<" . $info['name'] . "> : " . $info['desc'] . "\n" ); |
| 598 | + $this->output( wordwrap( "$tab<" . $info['name'] . "> : " . |
| 599 | + $info['desc'], $descWidth, "\n$tab$tab" ) . "\n" ); |
594 | 600 | } |
595 | 601 | die( 1 ); |
596 | 602 | } |