Changes as per review.

98f483068a (r45477503)

Signed-off-by: hjpotter92 <hjpotter92+github@gmail.com>
This commit is contained in:
hjpotter92 2020-12-29 03:26:19 +05:30
parent 757515996f
commit 7eaacb5c4a
1 changed files with 5 additions and 12 deletions

17
grc.zsh
View File

@ -2,7 +2,7 @@
if [ "$TERM" = dumb ] || (( ! $+commands[grc] ))
then
return
return
fi
# Supported commands
@ -82,21 +82,14 @@ cmds=(
whois
)
function setup_alias() {
local name="$1"
local path="$(which "$name")"
$name() {
grc --colour=auto $commands[$0] "$@"
}
compdef "_${name}" "$name"
}
# Set alias for available commands.
for cmd in $cmds ; do
if (( $+commands[$cmd] )) ; then
setup_alias $cmd
$cmd() {
grc --colour=auto ${commands[$0]} "$@"
}
fi
done
# Clean up variables
unset cmds cmd setup_alias
unset cmds cmd