#!/bin/bash ## usage: bash cleanup-Drupal.WhiteSpace.OperatorSpacing.NoSpaceAfter.sh vi ## usage: bash cleanup-Drupal.WhiteSpace.OperatorSpacing.NoSpaceAfter.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 'Drupal.WhiteSpace.OperatorSpacing.NoSpaceAfter' echo Number of lines: 6 echo Examples: 'Array ( [0] => Expected 1 space after \"-\"; 0 found [1] => Expected 1 space after \"+\"; 0 found ) ' echo Press ENTER to begin read edit_at_line 'CRM/Core/Payment/BaseIPN.php' 647 edit_at_line 'CRM/Event/Page/EventInfo.php' 198 edit_at_line 'CRM/Utils/Date.php' 1453 edit_at_line 'CRM/Utils/Date.php' 1553 edit_at_line 'CRM/Utils/Date.php' 1562 edit_at_line 'CRM/Utils/Date.php' 1622