diff options
Diffstat (limited to 'maintenance/Maintenance.php')
-rw-r--r-- | maintenance/Maintenance.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index d7297e98..24bb7809 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -565,10 +565,14 @@ abstract class Maintenance { } elseif ( substr( $arg, 0, 2 ) == '--' ) { # Long options $option = substr( $arg, 2 ); + if ( array_key_exists( $option, $options ) ) { + $this->error( "\nERROR: $option parameter given twice\n" ); + $this->maybeHelp( true ); + } if ( isset( $this->mParams[$option] ) && $this->mParams[$option]['withArg'] ) { $param = next( $argv ); if ( $param === false ) { - $this->error( "\nERROR: $option needs a value after it\n" ); + $this->error( "\nERROR: $option parameter needs a value after it\n" ); $this->maybeHelp( true ); } $options[$option] = $param; @@ -586,10 +590,14 @@ abstract class Maintenance { # Short options for ( $p = 1; $p < strlen( $arg ); $p++ ) { $option = $arg { $p } ; + if ( array_key_exists( $option, $options ) ) { + $this->error( "\nERROR: $option parameter given twice\n" ); + $this->maybeHelp( true ); + } if ( isset( $this->mParams[$option]['withArg'] ) && $this->mParams[$option]['withArg'] ) { $param = next( $argv ); if ( $param === false ) { - $this->error( "\nERROR: $option needs a value after it\n" ); + $this->error( "\nERROR: $option parameter needs a value after it\n" ); $this->maybeHelp( true ); } $options[$option] = $param; |