Index: trunk/phase3/maintenance/Maintenance.php |
— | — | @@ -597,10 +597,14 @@ |
598 | 598 | } elseif ( substr( $arg, 0, 2 ) == '--' ) { |
599 | 599 | # Long options |
600 | 600 | $option = substr( $arg, 2 ); |
| 601 | + if ( array_key_exists( $option, $options ) ) { |
| 602 | + $this->error( "\nERROR: $option parameter given twice\n" ); |
| 603 | + $this->maybeHelp( true ); |
| 604 | + } |
601 | 605 | if ( isset( $this->mParams[$option] ) && $this->mParams[$option]['withArg'] ) { |
602 | 606 | $param = next( $argv ); |
603 | 607 | if ( $param === false ) { |
604 | | - $this->error( "\nERROR: $option needs a value after it\n" ); |
| 608 | + $this->error( "\nERROR: $option parameter needs a value after it\n" ); |
605 | 609 | $this->maybeHelp( true ); |
606 | 610 | } |
607 | 611 | $options[$option] = $param; |
— | — | @@ -621,10 +625,14 @@ |
622 | 626 | if ( !isset( $this->mParams[$option] ) && isset( $this->mShortParamsMap[$option] ) ) { |
623 | 627 | $option = $this->mShortParamsMap[$option]; |
624 | 628 | } |
| 629 | + if ( array_key_exists( $option, $options ) ) { |
| 630 | + $this->error( "\nERROR: $option parameter given twice\n" ); |
| 631 | + $this->maybeHelp( true ); |
| 632 | + } |
625 | 633 | if ( isset( $this->mParams[$option]['withArg'] ) && $this->mParams[$option]['withArg'] ) { |
626 | 634 | $param = next( $argv ); |
627 | 635 | if ( $param === false ) { |
628 | | - $this->error( "\nERROR: $option needs a value after it\n" ); |
| 636 | + $this->error( "\nERROR: $option parameter needs a value after it\n" ); |
629 | 637 | $this->maybeHelp( true ); |
630 | 638 | } |
631 | 639 | $options[$option] = $param; |