Eliminated sed call from shortmap loading
All substitutions are all native shell.master
parent
c511222374
commit
df72cd4e71
|
@ -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"
|
||||
|
||||
|
|
Loading…
Reference in New Issue