1
0
Fork 0

Eliminated sed call from shortmap loading

All substitutions are all native shell.
master
Mike Gerwitz 2014-08-21 22:31:18 -04:00
parent c511222374
commit df72cd4e71
1 changed files with 5 additions and 4 deletions

View File

@ -95,10 +95,7 @@ __git-short_shortalias()
__git-short_load_maps()
{
local -r path="${1:-./shortmaps}"
sed 's/^\([^ ]\+ [^ ]\+\) :/\1 git /' \
"$path" ~/.git-shortmaps \
2>/dev/null
cat "$path" ~/.git-shortmaps 2>/dev/null
}
@ -114,6 +111,10 @@ declare -A __git_short_maps=() __git_short_comp=()
while read shortcmd comp cmd; do
test -n "$shortcmd" || continue
if [ "${cmd:0:1}" == : ]; then
cmd="git ${cmd:1}"
fi
__git_short_maps["$shortcmd"]="$cmd"
__git_short_comp["$shortcmd"]="$comp"