diff options
Diffstat (limited to 'Completion/Unix')
-rw-r--r-- | Completion/Unix/Command/.distfiles | 2 | ||||
-rw-r--r-- | Completion/Unix/Command/_mysqldiff | 31 |
2 files changed, 32 insertions, 1 deletions
diff --git a/Completion/Unix/Command/.distfiles b/Completion/Unix/Command/.distfiles index 3653a5f85..05bc38d4f 100644 --- a/Completion/Unix/Command/.distfiles +++ b/Completion/Unix/Command/.distfiles @@ -16,5 +16,5 @@ _dict _grep _lzop _prcs _tiff _elm _diff _gs _make _psutils _tin _apm _mail _last _loadkeys _modutils _ruby _sysctl _links _samba _user_admin _rsync _arping _spamassassin _mtools _ifconfig -_fsh _chkconfig _cdcd _irssi +_fsh _chkconfig _cdcd _irssi _mysqldiff ' diff --git a/Completion/Unix/Command/_mysqldiff b/Completion/Unix/Command/_mysqldiff new file mode 100644 index 000000000..1409afda5 --- /dev/null +++ b/Completion/Unix/Command/_mysqldiff @@ -0,0 +1,31 @@ +#compdef mysqldiff + +local curcontext="$curcontext" state line expl +typeset -A opt_args + +_mysqldiff () { + _arguments -s \ + {-h{,1,2},--host{,1,2}=}':server hostname:_mysql_hosts' \ + {-p{,1,2},--password{,1,2}=}':server password: ' \ + {-u{,1,2},--user{,1,2}=}':server username:_mysql_users' \ + {-s{,1,2},--socket{,1,2}=}':server socket:_directories' \ + {-d,--debug=}':debugging level (default 1):(1 2 3 4 5 6 7 8)' \ + {-i,--tolerant}':ignore DEFAULT and formatting changes: ' \ + {-k,--keep-old-tables}":don\'t output DROP TABLE commands: " \ + {-n,--no-old-defs}"[don't output old defs as comments]" \ + {-o,--only-both}'[only output changes for tables in both databases]' \ + {-t,--table-re}':restrict comparisons to tables matching a regexp: ' \ + {-A,--apply}':interactively patch database1 to match database2: ' \ + {-\?,--help}'[display usage]' \ + {1,2}':MySQL database:_mysql_db_or_file' +} + + +_mysql_db_or_file () { + _alternative \ + 'databases:MySQL databases:_mysql_databases' \ + 'files:MySQL database definition files:_files -g \*.\(my\|\)sql' +} + +_mysql_utils +_mysqldiff "$@" |