Skip to content

Commit 990d0d9

Browse files
committed
style: split command over multiple lines
1 parent ffcb26c commit 990d0d9

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

diff-so-fancy

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,10 @@ git_index_line_pattern="^($color_code_regex)index .*"
3131

3232
format_diff_header () {
3333
# simplify the unified patch diff header
34-
$SED -E "s/^($color_code_regex)diff --git .*$//g" | \
35-
$SED -E "/$git_index_line_pattern/{N;s/$git_index_line_pattern\n//}" | \
36-
$SED -E "s/^($color_code_regex)\-\-\-(.*)$/\1$(print_horizontal_rule)\\
37-
\1\-\-\-\5/g" | \
38-
$SED -E "s/^($color_code_regex)\+\+\+(.*)$/\1\+\+\+\5\\
39-
\1$(print_horizontal_rule)/g"
34+
$SED -E "s/^($color_code_regex)diff --git .*$//g" \
35+
| $SED -E "/$git_index_line_pattern/{N;s/$git_index_line_pattern\n//}" \
36+
| $SED -E "s/^($color_code_regex)\-\-\-(.*)$/\1$(print_horizontal_rule)\\n\1\-\-\-\5/g" \
37+
| $SED -E "s/^($color_code_regex)\+\+\+(.*)$/\1\+\+\+\5\\n\1$(print_horizontal_rule)/g"
4038
}
4139

4240
colorize_context_line () {
@@ -58,4 +56,9 @@ print_horizontal_rule () {
5856
}
5957

6058
# run it.
61-
cat $input | $diff_highlight | format_diff_header | colorize_context_line | mark_empty_lines | strip_leading_symbols
59+
cat $input \
60+
| $diff_highlight \
61+
| format_diff_header \
62+
| colorize_context_line \
63+
| mark_empty_lines \
64+
| strip_leading_symbols

0 commit comments

Comments
 (0)