See the code
$ drush mb
Enter the module name: foo
Enter the human readable name: bar
Enter the description: baz
Enter the dependencies: views
Enter available hooks: views_api
Proposed foo.module:
<?php
// $Id$
/**
* @file foo.module
* TODO: Enter file description here.
*/
/**
* Implementation of hook_views_api().
*/
function foo_views_api() {
return array(
'api' => 2,
'path' => drupal_get_path('module', 'foo'),
);
}
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 838660-9.module_builder.drush-wizard.patch | 5.32 KB | joachim |
| #8 | 838660-8.module_builder.drush-wizard.patch | 5.46 KB | dawehner |
| #6 | 838660-6.module_builder.drush-wizard.patch | 5.48 KB | joachim |
| #5 | 838660-5.module_builder.drush-wizard.patch | 4.65 KB | joachim |
| #2 | drush-wizard.patch | 3.1 KB | dawehner |
Comments
Comment #1
joachim commentedThis is great! Thanks :D
But sometimes (actually, most times), I don't want to bother entering the human name, help text, etc etc. Can we have it so entering blank skips those? At the moment it insists on entry.
I'm going to commit the part of this patch that's at #781294: change drush commands to match drush core now.
Comment #2
dawehnerThis sadly needs a drush patch #838684: allow drush_prompt to be optional
If the drush patch is not commited just the optional feature does not work
Comment #3
joachim commentedLooks good.
I kinda think maybe this handling of missing options by prompting should be moved up to Drush core. But that might take a while...
I'll have a ponder about a killswitch / onswitch for the interactive mode. Either --i to get the prompts or --noi to not, or something like that.
Comment #4
dawehner--interactive -i
I think it's worth to be the default.
so --non-interactive -noi would be fine
Comment #5
joachim commentedNot sure why we need this. The old code was happy to use get_option regardless, and we don't get to that line with anything set from the prompt. I reckon we can remove it.
Here's a reroll against some changes I've made on CVS. I've moved the hook prompt to be further up, so the crucial things are asked for first (and you can just bounce the return key for the rest). To do that I've had to get it into the generalized data array, which is a bit more convoluted...
Also implemented --non-interactive --noi though note it has to be --noi with two hyphens -- I assume single hyphen only works for a single letter option.
Can you take a look?
Comment #6
joachim commentedUpdated patch with help text.
Comment #7
joachim commentedBump...
@dereine: any chance you could review this? :)
Comment #8
dawehnerRight we can remove it. Here is a updated patch.
The rest looks fine.
Manual testing worked fine again.
Comment #9
joachim commentedAce :)
I've made another slight change so it's 'required' => TRUE rather than 'optional' => FALSE as that's consistent with FormAPI.
Committed the attached patch to both 6--2 and 7--2 branches (with reroll on the 7).
Thanks for all your work on this! It's made module builder a whole lot cooler!!! :D
#838660 by dereine, joachim: Added drush wizard.