From f6d07afd2399360e848bda2fc120724a7ccd44d4 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Sat, 5 May 2007 20:30:12 +0000 Subject: [PATCH] Actually do what the documentation says (r21907) --- maintenance/userOptions.inc | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/maintenance/userOptions.inc b/maintenance/userOptions.inc index 98150617a0..b889e1b8e5 100644 --- a/maintenance/userOptions.inc +++ b/maintenance/userOptions.inc @@ -108,10 +108,25 @@ class userOptions { $user = User::newFromId( $id->user_id ); // Get the options and update stats - foreach( $defaultOptions as $name => $defaultValue ) { - $userValue = $user->getOption( $name ); - if( $userValue <> $defaultValue ) { - @$ret[$name][$userValue]++; + if( $this->mAnOption ) { + + if(!array_key_exists( $this->mAnOption, $defaultOptions ) ) { + print "Invalid user option. Use --list to see valid choices\n"; + exit; + } + + $userValue = $user->getOption( $this->mAnOption ); + if( $userValue <> $defaultOptions[$this->mAnOption] ) { + @$ret[$this->mAnOption][$userValue]++; + } + + } else { + + foreach( $defaultOptions as $name => $defaultValue ) { + $userValue = $user->getOption( $name ); + if( $userValue <> $defaultValue ) { + @$ret[$name][$userValue]++; + } } } } -- 2.20.1