Index: branches/wmf/1.17wmf1/maintenance/Maintenance.php |
— | — | @@ -565,10 +565,14 @@ |
566 | 566 | } elseif ( substr( $arg, 0, 2 ) == '--' ) { |
567 | 567 | # Long options |
568 | 568 | $option = substr( $arg, 2 ); |
| 569 | + if ( array_key_exists( $option, $options ) ) { |
| 570 | + $this->error( "\nERROR: $option parameter given twice\n" ); |
| 571 | + $this->maybeHelp( true ); |
| 572 | + } |
569 | 573 | if ( isset( $this->mParams[$option] ) && $this->mParams[$option]['withArg'] ) { |
570 | 574 | $param = next( $argv ); |
571 | 575 | if ( $param === false ) { |
572 | | - $this->error( "\nERROR: $option needs a value after it\n" ); |
| 576 | + $this->error( "\nERROR: $option parameter needs a value after it\n" ); |
573 | 577 | $this->maybeHelp( true ); |
574 | 578 | } |
575 | 579 | $options[$option] = $param; |
— | — | @@ -586,10 +590,14 @@ |
587 | 591 | # Short options |
588 | 592 | for ( $p = 1; $p < strlen( $arg ); $p++ ) { |
589 | 593 | $option = $arg { $p } ; |
| 594 | + if ( array_key_exists( $option, $options ) ) { |
| 595 | + $this->error( "\nERROR: $option parameter given twice\n" ); |
| 596 | + $this->maybeHelp( true ); |
| 597 | + } |
590 | 598 | if ( isset( $this->mParams[$option]['withArg'] ) && $this->mParams[$option]['withArg'] ) { |
591 | 599 | $param = next( $argv ); |
592 | 600 | if ( $param === false ) { |
593 | | - $this->error( "\nERROR: $option needs a value after it\n" ); |
| 601 | + $this->error( "\nERROR: $option parameter needs a value after it\n" ); |
594 | 602 | $this->maybeHelp( true ); |
595 | 603 | } |
596 | 604 | $options[$option] = $param; |