diff options
author | Tuowen Zhao <ztuowen@gmail.com> | 2020-12-16 22:13:45 -0700 |
---|---|---|
committer | Tuowen Zhao <ztuowen@gmail.com> | 2020-12-16 22:13:45 -0700 |
commit | fb45741fc1dbd40dd2be72bc35a28c6ee8f3f7a5 (patch) | |
tree | dd7746c9910755dfeb5bf28bda68e28b47d5771f /plugins/grc/grc.plugin.zsh | |
parent | 3aaa0bc62ece494dd2b6e47a191de79e562156f9 (diff) | |
parent | b28665aebb4c1b07a57890eb59551bc51d0acf37 (diff) | |
download | zsh-fb45741fc1dbd40dd2be72bc35a28c6ee8f3f7a5.tar.gz zsh-fb45741fc1dbd40dd2be72bc35a28c6ee8f3f7a5.tar.bz2 zsh-fb45741fc1dbd40dd2be72bc35a28c6ee8f3f7a5.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'plugins/grc/grc.plugin.zsh')
-rw-r--r-- | plugins/grc/grc.plugin.zsh | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/plugins/grc/grc.plugin.zsh b/plugins/grc/grc.plugin.zsh new file mode 100644 index 000000000..6a52ec568 --- /dev/null +++ b/plugins/grc/grc.plugin.zsh @@ -0,0 +1,44 @@ +# Adapted from: https://github.com/garabik/grc/blob/master/grc.zsh + +if [[ "$TERM" = dumb ]] || (( ! $+commands[grc] )); then + return +fi + +# Supported commands +cmds=( + cc + configure + cvs + df + diff + dig + gcc + gmake + ifconfig + iwconfig + last + ldap + make + mount + mtr + netstat + ping + ping6 + ps + traceroute + traceroute6 + wdiff + whois +) + +# Set alias for supported commands +for cmd in $cmds; do + if (( $+commands[$cmd] )); then + eval "function $cmd { + grc --colour=auto \"${commands[$cmd]}\" \"\$@\" + }" + fi +done + +# Clean up variables +unset cmds cmd |