generate¶
Generate boilerplate code for modules/plugins/services etc.
Drush asks questions so that the generated code is as polished as possible. After generating, Drush lists the files that were created.
See https://github.com/Chi-teck/drupal-code-generator for a README and bug reports.
Help topics:
Examples¶
generate drush-command-filegenerate controller --answer=Example --answer=examplegenerate controller -vvv --dry-run
Arguments¶
- [generator]. A generator name. Omit to pick from available Generators.
Options¶
- --working-dir=WORKING-DIR. Absolute path to working directory.
- --dry-run. Output the generated code but not save it to file system.
- -a, --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
Global Options¶
- -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush core:global-options.
Aliases¶
- gen
Legend
- An argument or option with square brackets is optional.
- Any default value is listed at end of arg/option description.
- An ellipsis indicates that an argument accepts multiple values separated by a space.