浏览代码

ctools simplified

master
Dirk Alders 1年前
父节点
当前提交
c4f2368eac
共有 1 个文件被更改,包括 6 次插入5 次删除
  1. 6
    5
      .zshrc.d/__available__/ctools.zsh

+ 6
- 5
.zshrc.d/__available__/ctools.zsh 查看文件

@@ -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
-}

正在加载...
取消
保存