Clean up missing param error, show help on die. -params are still kind of wonky....
[lhc/web/wiklou.git] / maintenance / Maintenance.php
index 1e1ef99..22be3f3 100644 (file)
@@ -413,7 +413,8 @@ abstract class Maintenance {
                                if ( isset( $this->mParams[$option] ) && $this->mParams[$option]['withArg'] ) {
                                        $param = next( $argv );
                                        if ( $param === false ) {
-                                               $this->error( "$arg needs a value after it", true );
+                                               $this->error( "\nERROR: $option needs a value after it\n" );
+                                               $this->maybeHelp( true );
                                        }
                                        $options[$option] = $param;
                                } else {
@@ -433,7 +434,8 @@ abstract class Maintenance {
                                        if ( $this->mParams[$option]['withArg'] ) {
                                                $param = next( $argv );
                                                if ( $param === false ) {
-                                                       $this->error( "$arg needs a value after it", true );
+                                                       $this->error( "\nERROR: $option needs a value after it\n" );
+                                                       $this->maybeHelp( true );
                                                }
                                                $options[$option] = $param;
                                        } else {