#!/bin/bash ## usage: bash cleanup-Squiz.ControlStructures.SwitchDeclaration.SpaceBeforeColonCase.sh vi ## usage: bash cleanup-Squiz.ControlStructures.SwitchDeclaration.SpaceBeforeColonCase.sh joe [ -n "$1" ] && EDITOR="$1" if [ -z "$EDITOR" ]; then echo "Please provide parameter 1 (editor). Example: vi, joe" exit 1 fi function edit_at_line() { local f="$1" local l="$2" $EDITOR +$l "$f" } echo Process cleanup for 'Squiz.ControlStructures.SwitchDeclaration.SpaceBeforeColonCase' echo Number of lines: 3 echo Examples: 'Array ( [0] => There must be no space before the colon in a CASE statement ) ' echo Press ENTER to begin read edit_at_line 'CRM/Core/Payment/GoogleIPN.php' 591 edit_at_line 'CRM/Core/Payment/GoogleIPN.php' 597 edit_at_line 'CRM/Core/Payment/GoogleIPN.php' 623