def decorate_command(command):
        def _process_parallel(ctx, param, value):
            if value is None:
                return None
            n, i = map(int, value.split(':', 1))
            if n <= 1:
                raise click.BadParameter('N must be >1')
            if i not in range(n):
                raise click.BadParameter('I must be in [0..{})'.format(n))
            return n, i

        command = click.option('--default-group-provider', default='legacy-ldap',
                               help="Name of the default group provider")(command)
        command = click.option('-R', '--reference-type', 'reference_types', multiple=True,
                               help="Reference types ('report numbers'). Can be used multiple times "
                                    "to specify multiple reference types")(command)
        command = click.option('-P', '--parallel', metavar='N:I', callback=_process_parallel,
                               help='Parallel mode - migrates only events with `ID mod N = I`. '
                                    'When using this, you need to run the script N times with '
                                    'I being in [0..N)')(command)
        return command