+
+ /**
+ * Get module name from user.
+ *
+ * @return mixed|string
+ * Module name.
+ * @throws \Exception
+ * When module is not found.
+ */
+ public function getModuleOption()
+ {
+ $input = $this->getIo()->getInput();
+ $module = $input->getOption('module');
+ if (!$module) {
+ // @see Drupal\Console\Command\Shared\ModuleTrait::moduleQuestion
+ $module = $this->moduleQuestion();
+ $input->setOption('module', $module);
+ } else {
+ $missing_modules = $this->validator->getMissingModules([$module]);
+ if ($missing_modules) {
+ throw new \Exception(
+ sprintf(
+ $this->trans(
+ 'commands.module.download.messages.no-releases'
+ ),
+ $module
+ )
+ );
+ }
+ }
+
+ return $module;
+ }