public function registerUpdater()
    {
        $this->register(
            new UpdateServiceProvider(),
            array('update_url' => '@manifest_url@')
        );

        $app = $this;
        $command = $this->add(
            'update',
            function (
                InputInterface $input,
                OutputInterface $output
            ) use ($app) {
                $output->writeln('Looking for updates...');

                /** @var Console $updated */
                $console = $app['console'];
                $updated = $app['update'](
                    $console->getVersion(),
                    !$input->getOption('upgrade'),
                    $input->getOption('pre-release')
                );

                if ($updated) {
                    $output->writeln('<info>Updated successfully.</info>');
                } else {
                    $output->writeln('<comment>Already up-to-date.</comment>');
                }
            }
        );

        $command->addOption(
            'pre-release',
            'p',
            InputOption::VALUE_NONE,
            'Allow pre-release updates.'
        );

        $command->addOption(
            'upgrade',
            'u',
            InputOption::VALUE_NONE,
            'Allow upgrade to next major release.'
        );

        return $this;
    }