Default source argument for bash_completion is now full path name
parent
fadd65b69b
commit
2b2452dda9
|
@ -8,10 +8,10 @@ The `bash_completion` file contains Bash completion for custom commands and
|
|||
## Setup
|
||||
Source the `bash_completion` file (e.g. place in `.bashrc` or in
|
||||
`/etc/bash_completion.d/` on Debian systems), with the path to the provided
|
||||
shortmaps file as the only argument:
|
||||
`shortmaps` file as the only argument:
|
||||
|
||||
```
|
||||
$ . bash_completion .
|
||||
$ . bash_completion ./shortmaps
|
||||
```
|
||||
|
||||
You may also add your own mappings to `~/.git-shortmaps`.
|
||||
|
|
|
@ -33,8 +33,7 @@ __git-short_shortmap ()
|
|||
}
|
||||
|
||||
# load shortmaps from cwd (or provided path) and home dir (if available)
|
||||
__git_short_maps=$( cat ${1:-.}/shortmaps ~/.git-shortmaps 2>/dev/null )
|
||||
|
||||
__git_short_maps=$( cat ${1:-./shortmaps} ~/.git-shortmaps 2>/dev/null )
|
||||
|
||||
# register each shortmap
|
||||
IFS=$'\n'
|
||||
|
@ -43,9 +42,9 @@ for line in $__git_short_maps; do
|
|||
set -- $line
|
||||
short=$1
|
||||
|
||||
[ -z "$1" ] && continue
|
||||
__git-short_docomplete "$1" __git-short_shortmap
|
||||
|
||||
shift 2
|
||||
alias $short="$( sed 's/^:/git /' <<< "$@" )"
|
||||
done
|
||||
|
||||
|
|
Loading…
Reference in New Issue