File tree 2 files changed +22
-10
lines changed
2 files changed +22
-10
lines changed Original file line number Diff line number Diff line change @@ -30,8 +30,16 @@ rotateColorPrint() {
30
30
fi
31
31
}
32
32
33
- # Bash read line does not read leading spaces
34
- # https://stackoverflow.com/questions/29689172
35
- cat " $@ " | while IFS= read -r line; do
36
- rotateColorPrint " $line "
37
- done
33
+ colorLines () {
34
+ # Bash read line does not read leading spaces
35
+ # https://stackoverflow.com/questions/29689172
36
+ while IFS= read -r line; do
37
+ rotateColorPrint " $line "
38
+ done
39
+ }
40
+
41
+ if [ $# == 0 ]; then
42
+ colorLines
43
+ else
44
+ cat " $@ " | colorLines
45
+ fi
Original file line number Diff line number Diff line change @@ -30,8 +30,12 @@ rotateColorPrint() {
30
30
fi
31
31
}
32
32
33
- # Bash read line does not read leading spaces
34
- # https://stackoverflow.com/questions/29689172
35
- tac " $@ " | while IFS= read -r line; do
36
- rotateColorPrint " $line "
37
- done
33
+ colorLines () {
34
+ # Bash read line does not read leading spaces
35
+ # https://stackoverflow.com/questions/29689172
36
+ while IFS= read -r line; do
37
+ rotateColorPrint " $line "
38
+ done
39
+ }
40
+
41
+ tac " $@ " | colorLines
You can’t perform that action at this time.
0 commit comments