#!/bin/bash # # Wrapper around phpcs for Emacs flymake since flymake dislikes phpcs' exit code. showhelp() { echo "flymake_phpcs [-h] [] Run phpcs and \"php -l\" on in a manner appropriate for use by Emacs flymake-phpcs.el. -h Display this help. The source file to run the checks on. Any additional argments on the commandline will be passed to phpcs."; exit 0; } FILE_NAME="$1" shift # Run with --report=emacs so we can use this for compile-mode too. phpcs --report=emacs "$FILE_NAME" $* # Run php -l too for good measure. php -l -f "$FILE_NAME" exit 0