Browse Source

Autocompletion for ee log command

bugfixes
gau1991 10 years ago
parent
commit
6ebee1a11d
  1. 16
      config/bash_completion.d/ee_auto.rc
  2. 4
      ee/cli/plugins/log.py

16
config/bash_completion.d/ee_auto.rc

@ -59,7 +59,7 @@ _ee_complete()
"log")
COMPREPLY=( $(compgen \
-W "$(command find /etc/nginx/sites-enabled/ -type l -printf "%P " 2> /dev/null) --mysql --php --nginx --all" \
-W "show reset gzip email" \
-- $cur) )
;;
@ -74,7 +74,7 @@ _ee_complete()
# HANDLE EVERYTHING AFTER THE THIRD LEVEL NAMESPACE
"install" | "purge" | "remove" )
COMPREPLY=( $(compgen \
-W "--web --admin --mail --nginx --php --mysql --postfix --wpcli --phpmyadmin --adminer --utils --memcache --dovecot --all --mailscanner" \
-W "--web --admin --mail --nginx --php --mysql --postfix --wpcli --phpmyadmin --adminer --utils --memcache --dovecot --all --mailscanner --hhvm" \
-- $cur) )
;;
"start" | "stop" | "reload" | "restart" | "status")
@ -99,6 +99,18 @@ _ee_complete()
-- $cur) )
;;
"show" | "gzip" | "email")
COMPREPLY=( $(compgen \
-W "$(find /etc/nginx/sites-available/ -type f -printf "%P " 2> /dev/null) --nginx --php --fpm --mysql --wp --access" \
-- $cur) )
;;
"reset")
COMPREPLY=( $(compgen \
-W "$(find /etc/nginx/sites-available/ -type f -printf "%P " 2> /dev/null) --nginx --php --fpm --mysql --wp --access --slow-log--db" \
-- $cur) )
;;
"disable")
COMPREPLY=( $(compgen \
-W "$(command find /etc/nginx/sites-enabled/ -type l -printf "%P " 2> /dev/null)" \

4
ee/cli/plugins/log.py

@ -102,9 +102,7 @@ class EELogShowController(CementBaseController):
if os.path.isfile('/var/log/mysql/mysql-slow.log'):
self.msg = self.msg + ['/var/log/mysql/mysql-slow.log']
else:
Log.error(self, "Unable to find MySQL slow log file,"
"Please generate it using commnad ee debug "
"--mysql")
Log.info(self, "MySQL slow-log not found, skipepd")
else:
Log.warn(self, "Remote MySQL found, EasyEngine is not able to"
"show MySQL log file")

Loading…
Cancel
Save