#!/bin/bash ## usage: bash cleanup-Drupal.Formatting.SpaceInlineIf.SpacingBefore.sh vi ## usage: bash cleanup-Drupal.Formatting.SpaceInlineIf.SpacingBefore.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.Formatting.SpaceInlineIf.SpacingBefore' echo Number of lines: 11 echo Examples: 'Array ( [0] => Expected 1 space before \"?\"; 5 found [1] => Expected 1 space before \"?\"; 2 found [2] => Expected 1 space before \"?\"; newline found [3] => Expected 1 space before \":\"; newline found ) ' echo Press ENTER to begin read edit_at_line 'CRM/Contact/BAO/Contact/Optimizer.php' 133 edit_at_line 'CRM/Contact/BAO/Contact/Optimizer.php' 134 edit_at_line 'CRM/Contact/BAO/Contact/Optimizer.php' 148 edit_at_line 'CRM/Contact/BAO/Contact/Optimizer.php' 149 edit_at_line 'CRM/Mailing/Event/BAO/Bounce.php' 272 edit_at_line 'CRM/Mailing/Selector/Event.php' 450 edit_at_line 'CRM/Mailing/Selector/Event.php' 451 edit_at_line 'CRM/Mailing/Selector/Event.php' 455 edit_at_line 'CRM/Mailing/Selector/Event.php' 456 edit_at_line 'CRM/Mailing/Selector/Event.php' 458 edit_at_line 'CRM/Mailing/Selector/Event.php' 459