From b16ae2647dfcf06eab48ce3e82ccdbc2e60095ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Garab=C3=ADk?= Date: Wed, 18 Nov 2020 16:44:59 +0100 Subject: [PATCH] clean up zsh syntax --- grc.zsh | 173 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 87 insertions(+), 86 deletions(-) diff --git a/grc.zsh b/grc.zsh index be69ac3..aaaa4b9 100644 --- a/grc.zsh +++ b/grc.zsh @@ -1,88 +1,89 @@ -if [[ "$TERM" != dumb ]] && (( $+commands[grc] )) ; then - - # Supported commands - cmds=( - as - ant - blkid - cc - configure - cvs - df - diff - dig - dnf - docker - docker-compose - docker-machine - du - env - fdisk - findmnt - free - g++ - gas - gcc - getfacl - getsebool - gmake - id - ifconfig - iostat - ip - iptables - iwconfig - journalctl - kubectl - last - ldap - lolcat - ld - ls - lsattr - lsblk - lsmod - lsof - lspci - make - mount - mtr - mvn - netstat - nmap - ntpdate - php - ping - ping6 - proftpd - ps - sar - semanage - sensors - showmount - ss - stat - sysctl - systemctl - tcpdump - traceroute - traceroute6 - tune2fs - uptime - vmstat - wdiff - whois - sockstat - ) - - # Set alias for available commands. - for cmd in $cmds ; do - if (( $+commands[$cmd] )) ; then - alias $cmd="grc $(whence $cmd)" - fi - done - - # Clean up variables - unset cmds cmd +if [[ "$TERM" = dumb ]] || (( ! $+commands[grc] )); then + return fi +# Supported commands +cmds=( + as + ant + blkid + cc + configure + cvs + df + diff + dig + dnf + docker + docker-compose + docker-machine + du + env + fdisk + findmnt + free + g++ + gas + gcc + getfacl + getsebool + gmake + id + ifconfig + iostat + ip + iptables + iwconfig + journalctl + kubectl + last + ldap + lolcat + ld + ls + lsattr + lsblk + lsmod + lsof + lspci + make + mount + mtr + mvn + netstat + nmap + ntpdate + php + ping + ping6 + proftpd + ps + sar + semanage + sensors + showmount + sockstat + ss + stat + sysctl + systemctl + tcpdump + traceroute + traceroute6 + tune2fs + uptime + vmstat + wdiff + whois +) + +# Set alias for available commands. +for cmd in $cmds ; do + if (( $+commands[$cmd] )) ; then + alias $cmd="grc --colour=auto $commands[$cmd]" + fi +done + +# Clean up variables +unset cmds cmd +