-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Created uuid command to generate new UUIDs. #21
Conversation
Thanks. Hmmm. This is part of Drupal core but I think this is pretty rarely used functionality. When do you imagine it being used? I think this fits better with devel's drush integration.
|
If the output is a simple string, then there is no need to format it with the outputformat system. However, I think it is still useful to return the string as the function result & let Drush print it, for consistency. As mentioned above, returning the output as the function result will also make it available to backend calls (or folks who may want to call your command function directly). |
Thanks for the feedback! Integrating it with the Devel module instead of core Drush makes sense indeed, as this is mainly for developer use. I'll make an issue in the Devel issue queue. I was also thinking of adding a "n" argument so you can request multiple UUIDs:
|
I don't think many unix commands offer a 'repeat n times' option. Probably best to do it in a loop outside of drush |
@greg-1-anderson - Returning a string from a command callback will now automatically get it printed. I just tested this. Perhaps we have a bug. |
Here's the issue I opened for the Devel module: Provide a drush command to generate UUIDs. I've reworked the patch a bit and am returning the value now as well as printing it. BTW for me the string is not printed automatically when returned, I have to explicitly print it. Thanks for the feedback and suggestions! |
The outputformat code didn't actually work as I describe above. I submitted a pull request that brings the code into alignment with my expectations; see: #24 |
In Drupal 8 we will be dealing with UUIDs, see for example Add UUIDs to default configuration. Here is a simple drush command that will output a fresh UUID on the command line.