/**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $errOutput = $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output;
     $action = new RegisterUserAction();
     $action->setUsername($input->getOption('username'));
     $action->setDisplayName($input->getOption('display-name'));
     $action->setEmail($input->getOption('email'));
     $action->setPassword($input->getOption('password'));
     $validator = $this->getContainer()->get('validator');
     $violations = $validator->validate($action);
     if (count($violations) > 0) {
         $errOutput->writeln('<comment>There are some errors:</comment>');
         foreach ($violations as $violation) {
             $errOutput->writeln(sprintf('  - %s: <error>%s</error>', $violation->getPropertyPath(), $violation->getMessage()));
         }
         return 1;
     }
     $user = $this->getContainer()->get('openl10n.processor.register_user')->execute($action);
     $output->writeln(sprintf('<info>User <comment>%s</comment> created</info>', $user->getUsername()));
 }