}
}
} else {
- throw new Exception("You have to provide an ID or nickname or 'all'.");
+ show_help();
+ exit(1);
}
} catch (Exception $e) {
print $e->getMessage()."\n";
function updateAvatars($user)
{
+ $touched = false;
+
if (!have_option('q', 'quiet')) {
print "Updating avatars for user '".$user->nickname."' (".$user->id.")...";
}
if (!$avatar->query($sql)) {
throw new Exception("Can't update avatar for user " . $user->nickname . ".");
+ } else {
+ $touched = true;
}
}
}
+ }
+ if ($touched) {
+ $profile = $user->getProfile();
+ common_broadcast_profile($profile);
}
+
if (have_option('v', 'verbose')) {
- print "DONE.\n";
+ print "DONE.";
+ }
+ if (!have_option('q', 'quiet') || have_option('v', 'verbose')) {
+ print "\n";
}
}