fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
d835c5252
master
1# localization: tier3 2function __fish_mysql_query -a query 3argparse -u'u/user=' 'P/port=' 'h/host=' 'p/password=?' 'S/socket=' --( commandline -px) 4set -l mysql_cmd mysql 5for flagin u P h S 6if set -q _flag_$flag 7set -l flagvar _flag_$flag 8set -a mysql_cmd -$flag $$flagvar 9end 10end 11if test -n " $_flag_p " 12set -a mysql_cmd -p$_flag_p 13end 14echo $query | $mysql_cmd 2> /dev/null 15end 16 17function __fish_complete_mysql_databases 18__fish_mysql_query 'show databases' 19end 20 21function __fish_complete_mysql 22set -l command$argv [ 1 ] 23 24complete -c$command -s D -l database -x -d'The database to use' -a'(__fish_complete_mysql_databases)' 25complete -c$command -a'(__fish_complete_mysql_databases)' 26end