1
0
Fork 0

bash_completion now works with lazily-loaded completions

master
Mike Gerwitz 2015-01-09 00:07:15 -05:00
parent 7289ae3a63
commit 901b8d36f9
No known key found for this signature in database
GPG Key ID: F22BB8158EE30EAB
1 changed files with 6 additions and 2 deletions

View File

@ -2,7 +2,7 @@
#
# Provides short mappings for common Git commands
#
# Copyright (C) 2011, 2012, 2013, 2014 Mike Gerwitz
# Copyright (C) 2011, 2012, 2013, 2014, 2015 Mike Gerwitz
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -20,6 +20,10 @@
declare -r __git_short_path="${1:-$(pwd)/shortmaps}"
# some distros use completion lazy-loading
type -t _completion_loader &>/dev/null \
&& _completion_loader git
__git-short_cmdok()
{
@ -35,7 +39,7 @@ __git-short_docomplete()
# ignore problem commands
__git-short_cmdok "$cmd" || return
complete -o bashdefault -o default -o nospace -F"$fn" "$cmd" 2>/dev/null \
complete -o bashdefault -o default -o nospace -F"$fn" "$cmd" 1>/dev/null \
|| complete -o default -o nospace -F"$fn" "$cmd"
}