Pārlūkot izejas kodu

ctools simplified

master
Dirk Alders 1 gadu atpakaļ
vecāks
revīzija
c4f2368eac
1 mainītis faili ar 6 papildinājumiem un 5 dzēšanām
  1. 6
    5
      .zshrc.d/__available__/ctools.zsh

+ 6
- 5
.zshrc.d/__available__/ctools.zsh Parādīt failu

@@ -1,11 +1,12 @@
1
+ccat(){
2
+    cat $* | sed -u "s/ERROR/$(tput setaf 1)&$(tput sgr0)/gI"|sed -u "s/WARNING/$(tput setaf 3)&$(tput sgr0)/gI"|sed -u "s/INFO/$(tput setaf 2)&$(tput sgr0)/gI"|sed -u "s/DEBUG/$(tput setaf 6)&$(tput sgr0)/gI"
3
+}
4
+
1 5
 ctail(){
2
-    tail $* | sed -u "s/ERROR/$(tput setaf 1)&$(tput sgr0)/gI"|sed -u "s/WARNING/$(tput setaf 3)&$(tput sgr0)/gI"|sed -u "s/INFO/$(tput setaf 2)&$(tput sgr0)/gI"|sed -u "s/DEBUG/$(tput setaf 6)&$(tput sgr0)/gI"
6
+    tail $* | ccat"
3 7
 }
4 8
 
5 9
 cgrep(){
6
-    grep $* | sed -u "s/ERROR/$(tput setaf 1)&$(tput sgr0)/gI"|sed -u "s/WARNING/$(tput setaf 3)&$(tput sgr0)/gI"|sed -u "s/INFO/$(tput setaf 2)&$(tput sgr0)/gI"|sed -u "s/DEBUG/$(tput setaf 6)&$(tput sgr0)/gI"
10
+    grep $* | ccat"
7 11
 }
8 12
 
9
-ccat(){
10
-    cat $* | sed -u "s/ERROR/$(tput setaf 1)&$(tput sgr0)/gI"|sed -u "s/WARNING/$(tput setaf 3)&$(tput sgr0)/gI"|sed -u "s/INFO/$(tput setaf 2)&$(tput sgr0)/gI"|sed -u "s/DEBUG/$(tput setaf 6)&$(tput sgr0)/gI"
11
-}

Notiek ielāde…
Atcelt
Saglabāt