$script->shutdown( 1, 'Invalid mode. Use either d for detailed or a for automatic.' );
    }

    $mode = $options['mode'];
}
else
{
    $mode = false;
}


$db = eZDB::instance();

$cli->output( '' );
$cli->output( 'Removing temporary content classes...' );
eZContentClass::removeTemporary();
$cli->output( '' );

$nonUniqueRemoteIDDataList = $db->arrayQuery( 'SELECT COUNT( id ) AS cnt, remote_id FROM ezcontentclass GROUP BY remote_id HAVING COUNT( id ) > 1' );

$nonUniqueRemoteIDDataListCount = count( $nonUniqueRemoteIDDataList );

$cli->output( '' );
$cli->output( "Found $nonUniqueRemoteIDDataListCount non-unique content class remote IDs." );
$cli->output( '' );

$totalCount = 0;

foreach ( $nonUniqueRemoteIDDataList as $nonUniqueRemoteIDData )
{
    if ( $mode )