2020-12-28 15:59:22 +01:00
|
|
|
#!/usr/bin/env zsh
|
|
|
|
|
2021-07-06 17:37:37 +02:00
|
|
|
if ! tty -s || [ ! -n "$TERM" ] || [ "$TERM" = dumb ] || (( ! $+commands[grc] ))
|
2020-12-28 16:01:41 +01:00
|
|
|
then
|
2020-12-28 22:56:19 +01:00
|
|
|
return
|
2020-11-18 16:44:59 +01:00
|
|
|
fi
|
2015-10-10 16:35:08 +02:00
|
|
|
|
2020-11-18 16:44:59 +01:00
|
|
|
# Supported commands
|
|
|
|
cmds=(
|
|
|
|
as
|
|
|
|
ant
|
|
|
|
blkid
|
|
|
|
cc
|
|
|
|
configure
|
2020-12-28 16:15:20 +01:00
|
|
|
curl
|
2020-11-18 16:44:59 +01:00
|
|
|
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
|
2020-12-28 16:15:20 +01:00
|
|
|
ulimit
|
2020-11-18 16:44:59 +01:00
|
|
|
uptime
|
|
|
|
vmstat
|
|
|
|
wdiff
|
|
|
|
whois
|
|
|
|
)
|
2015-10-10 16:35:08 +02:00
|
|
|
|
2020-11-18 16:44:59 +01:00
|
|
|
# Set alias for available commands.
|
|
|
|
for cmd in $cmds ; do
|
|
|
|
if (( $+commands[$cmd] )) ; then
|
2020-12-28 22:56:19 +01:00
|
|
|
$cmd() {
|
|
|
|
grc --colour=auto ${commands[$0]} "$@"
|
|
|
|
}
|
2020-11-18 16:44:59 +01:00
|
|
|
fi
|
|
|
|
done
|
2015-10-10 16:35:08 +02:00
|
|
|
|
2020-11-18 16:44:59 +01:00
|
|
|
# Clean up variables
|
2020-12-28 22:56:19 +01:00
|
|
|
unset cmds cmd
|