Closed (won't fix)
Project:
Drush
Version:
8.x-6.x-dev
Component:
Core Commands
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
14 Dec 2012 at 06:48 UTC
Updated:
11 Sep 2013 at 11:37 UTC
I was preparing a site to be demoed and realized xhprof module was still enabled, so I tried to disable it.
I meant to type "drush dis -y xhprof".
In my haste, I typed drush *is*, -y, which ended up dropping my database.
Given how often we type -y, and how common dis is, it seems reasonable for the command to not be 1 letter away from dropping your database.
commonsint@ded-116:/var/www/html/commonsint.prod/docroot$ drush is xhprof 0-y
Warning: The command name "is" is deprecated. Please use a recommended form instead (site-install,si). [warning]
You are about to DROP your 'commonsint' database and then CREATE a new one. Do you want to continue? (y/n): ^C
Comments
Comment #1
ezra-g commentedAnother way of protecting folks from themselves would be to require a different type of confirmation for commands that drop your DB.
Comment #2
owen barton commentedI can see some folks insisting that we just need to type every command with care, but I agree with this - it's really easy to do right now.
How about something like this:
Regular commands:
Commands that destroy data (sql-drop, site-install with existing db, pm-uninstall...others?):
Comment #3
moshe weitzman commentedFor the record, you must have typed si, not is. Thats more than one character off.
I'm not yet sold on the proposal but let's gather more feedback.
Comment #4
greg.1.anderson commentedI type destructive commands with -y fairly frequently, and mean it. Maybe we should just have a sample policy file that shows users how to add extra protection to destructive commands if they want it?
You can also override aliases that you don't like with a shell alias, which will take precedence over the built-in command.
$options['shell-aliases']['si'] = '!echo Can\'t touch this';
Comment #5
jonhattanFor the record, ezra-g seems to be using drush 4. Since 5.x,
isis no an alias, but a shell-alias example in example.drushrc.php.Other potentially destructive command is trying to simulate rsync run, since -s is a valid rsync flag.
-s as simulate:
drush -s rsync %source %dest-s to rsync:
drush rsync -s %source %destComment #6
greg.1.anderson commentedI would not mind getting rid of 'si' as an alias, but wouldn't want to see extra prompting implemented (outside of an example policy file).
Comment #7
greg.1.anderson commentedThis issue was marked
closed (won't fix)because Drush has moved to Github.If this feature is still desired, you may copy it to our Github project. For best results, create a Pull Request that has been updated for the master branch. Post a link here to the PR, and please also change the status of this issue to
closed (duplicate).Please ask support questions on Drupal Answers.