diff options
Diffstat (limited to 'maintenance/userOptions.inc')
-rw-r--r-- | maintenance/userOptions.inc | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/maintenance/userOptions.inc b/maintenance/userOptions.inc index cbe6b057..51da80d3 100644 --- a/maintenance/userOptions.inc +++ b/maintenance/userOptions.inc @@ -25,7 +25,7 @@ $options = array( 'list', 'nowarn', 'quiet', 'usage', 'dry' ); $optionsWithArgs = array( 'old', 'new' ); -require_once( __DIR__ . '/commandLine.inc' ); +require_once __DIR__ . '/commandLine.inc'; /** * @ingroup Maintenance @@ -38,7 +38,7 @@ class userOptions { public $mOldValue; public $mNewValue; - private $mMode, $mReady ; + private $mMode, $mReady; /** Constructor. Will show usage and exit if script options are not correct */ function __construct( $opts, $args ) { @@ -60,9 +60,9 @@ class userOptions { */ private function checkOpts( $opts, $args ) { // The three possible ways to run the script: - $list = isset( $opts['list'] ); - $usage = isset( $opts['usage'] ) && ( count( $args ) <= 1 ); - $change = isset( $opts['old'] ) && isset( $opts['new'] ) && ( count( $args ) <= 1 ) ; + $list = isset( $opts['list'] ); + $usage = isset( $opts['usage'] ) && ( count( $args ) <= 1 ); + $change = isset( $opts['old'] ) && isset( $opts['new'] ) && ( count( $args ) <= 1 ); // We want only one of them $isValid = ( ( $list + $usage + $change ) == 1 ); @@ -82,18 +82,18 @@ class userOptions { $this->mQuick = isset( $opts['nowarn'] ); $this->mQuiet = isset( $opts['quiet'] ); - $this->mDry = isset( $opts['dry'] ); + $this->mDry = isset( $opts['dry'] ); // Set object properties, specially 'mMode' used by run() if ( isset( $opts['list'] ) ) { - $this->mMode = 'LISTER' ; + $this->mMode = 'LISTER'; } elseif ( isset( $opts['usage'] ) ) { - $this->mMode = 'USAGER' ; - $this->mAnOption = isset( $args[0] ) ? $args[0] : false ; + $this->mMode = 'USAGER'; + $this->mAnOption = isset( $args[0] ) ? $args[0] : false; } elseif ( isset( $opts['old'] ) && isset( $opts['new'] ) ) { - $this->mMode = 'CHANGER' ; - $this->mOldValue = $opts['old'] ; - $this->mNewValue = $opts['new'] ; + $this->mMode = 'CHANGER'; + $this->mOldValue = $opts['old']; + $this->mNewValue = $opts['new']; $this->mAnOption = $args[0]; } else { die( "There is a bug in the software, this should never happen\n" ); @@ -212,7 +212,9 @@ class userOptions { if ( !$this->mDry ) { $user->saveSettings(); } - if ( !$this->mQuiet ) { print " OK\n"; } + if ( !$this->mQuiet ) { + print " OK\n"; + } } elseif ( !$this->mQuiet ) { print "Not changing '$username' using <{$this->mAnOption}> = '$curValue'\n"; |