Chris@0: directory); Chris@0: // The suggestion depends on whether the command global or local. Chris@0: $prefix = $directoryBaseName == 'drush' || $directoryBaseName == '.drush' ? Chris@0: $vars['command_name'] : $directoryBaseName; Chris@0: return str_replace('-', '_', $prefix) . '.drush.inc'; Chris@0: }; Chris@0: Chris@0: $questions = [ Chris@0: 'command_name' => new Question('Command name', ''), Chris@0: 'alias' => new Question('Command alias', $default_alias), Chris@0: 'description' => new Question('Command description', 'Command description.'), Chris@0: 'argument' => new Question('Argument name', 'foo'), Chris@0: 'option' => new Question('Option name', 'bar'), Chris@0: 'command_file' => new Question('Command file', $default_command_file), Chris@0: ]; Chris@0: Chris@0: $vars = &$this->collectVars($input, $output, $questions); Chris@0: Chris@0: list($vars['command_file_prefix']) = explode('.drush.inc', $vars['command_file']); Chris@0: Chris@0: // Command callback name pattern gets shorter if command file name matches Chris@0: // command name. Chris@0: $vars['command_callback_suffix'] = $vars['command_file_prefix'] == str_replace('-', '_', $vars['command_name']) Chris@0: ? $vars['command_file_prefix'] Chris@0: : $vars['command_file_prefix'] . '_' . $vars['command_name']; Chris@0: Chris@0: $this->addFile() Chris@0: ->path('{command_file}') Chris@0: ->template('other/drush-command.twig'); Chris@0: } Chris@0: Chris@0: }