Closed (fixed)
Project:
Drush
Version:
8.x-6.x-dev
Component:
SQL
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
6 Nov 2012 at 16:09 UTC
Updated:
8 May 2013 at 20:50 UTC
Jump to comment: Most recent file
When you run drush sql-cli, the underlying mysql process can display information about the -A argument:
[16:07:01] root@ded-66.bjaspan:~# drush @dbimport.dev sql-cli -A
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
...
This isn't drush's fault, but it could confuse users. Perhaps the simplest solution is for sql-cli to accept the -A arg and pass it on to mysql.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | drush-metadata-1833470-10.patch | 1.22 KB | posulliv |
| #8 | drush-metadata-1833470-7.patch | 792 bytes | posulliv |
| #6 | drush-metadata-1833470-6.patch | 5.68 KB | posulliv |
| #1 | drush-metadata-1833470-1.patch | 1009 bytes | posulliv |
Comments
Comment #1
posulliv commentedAttached is a patch to add an option that only applies to MySQL for the
sql-clicommand.Comment #2
greg.1.anderson commentedMaybe a better option would be to make sql-cli a strict options command. See
drush topic docs-strict-optionsand the implementation of the core-rsync command.Comment #3
greg.1.anderson commentedAdjusting status.
Comment #4
moshe weitzman commentedStrict options is a usability fail for me. I want us to use that only when we really need it on a given command.
Comment #5
greg.1.anderson commentedOkay, we would not have to use strict options; we could instead set
'allow-additional-options' => TRUEon sql-cli, which would allow us to usedrush_get_option('A')instead ofdrush_get_option('skip-metadata'), as in #1, which would allow the option to match the message. That would fix just the issue described by the OP; if we used strict options, we could also pass through other mysql options.Comment #6
posulliv commentedThanks for the feedback and direction. Attached is a patch that uses the
allow-additional-optionsstrategy.Comment #7
posulliv commentedMy bad, I needed to rebase my branch so there is some extra diffs in the patch in #6. Correct patch attached to this comment.
Comment #8
posulliv commentedComment #9
greg.1.anderson commentedDoes it also work if you leave off the 'allow-additional-options' and just set 'A' as an option? Don't have time to run the experiment right now, but I was just thinking that would work. The thing about that is that
drush help sql-cliwould then report that the option was --A instead of -A; however, I think that -A still works.I'm not sure which is less confusing. At a minimum, I think that we should have an example (in the 'examples' section of sql-cli) that uses the -A option.
Thanks for working on this.
Comment #10
posulliv commentedThis patch removes the
allow-additional-optionsand it does indeed work as you expected.So both
-Aand--Ahave the same effect now when passed as an option.I also added an example.
Comment #11
moshe weitzman commentedcommitted to 5 and 6 branches. thanks.