forked from garabik/grc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
grc.zsh
95 lines (91 loc) · 965 Bytes
/
grc.zsh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/usr/bin/env zsh
if ! tty -s || [ ! -n "$TERM" ] || [ "$TERM" = dumb ] || (( ! $+commands[grc] ))
then
return
fi
# Supported commands
cmds=(
as
ant
blkid
cc
configure
curl
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
ulimit
uptime
vmstat
wdiff
whois
)
# Set alias for available commands.
for cmd in $cmds ; do
if (( $+commands[$cmd] )) ; then
$cmd() {
grc --colour=auto ${commands[$0]} "$@"
}
fi
done
# Clean up variables
unset cmds cmd