mirror of
https://github.com/garabik/grc.git
synced 2024-11-15 14:48:26 +01:00
5d7c715ea9
Consider existing aliases when defining aliases in zsh
40 lines
591 B
Bash
40 lines
591 B
Bash
if [[ "$TERM" != dumb ]] && (( $+commands[grc] )) ; then
|
|
|
|
# Supported commands
|
|
cmds=(
|
|
cc \
|
|
configure \
|
|
cvs \
|
|
df \
|
|
diff \
|
|
dig \
|
|
gcc \
|
|
gmake \
|
|
ifconfig \
|
|
last \
|
|
ldap \
|
|
ls \
|
|
make \
|
|
mount \
|
|
mtr \
|
|
netstat \
|
|
ping \
|
|
ping6 \
|
|
ps \
|
|
traceroute \
|
|
traceroute6 \
|
|
wdiff \
|
|
whois \
|
|
iwconfig \
|
|
);
|
|
|
|
# Set alias for available commands.
|
|
for cmd in $cmds ; do
|
|
if (( $+commands[$cmd] )) ; then
|
|
alias $cmd="grc --colour=auto $(whence $cmd)"
|
|
fi
|
|
done
|
|
|
|
# Clean up variables
|
|
unset cmds cmd
|
|
fi
|