formatted makefile completion and used helper function
parent
9e483a9d78
commit
244c6a62b5
|
|
@ -1,7 +1,9 @@
|
||||||
# Bash completion for Makefile
|
# Bash completion for Makefile
|
||||||
# Loosely adapted from http://stackoverflow.com/a/38415982/1472048
|
# Loosely adapted from http://stackoverflow.com/a/38415982/1472048
|
||||||
|
|
||||||
_makecomplete() {
|
if _command_exists make || _command_exists gnumake
|
||||||
|
then
|
||||||
|
function __makefile_completions() {
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
|
|
||||||
# https://www.gnu.org/software/make/manual/html_node/Makefile-Names.html
|
# https://www.gnu.org/software/make/manual/html_node/Makefile-Names.html
|
||||||
|
|
@ -30,5 +32,6 @@ _makecomplete() {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
complete -o nospace -F _makecomplete make
|
complete -o nospace -F __makefile_completions make
|
||||||
complete -o nospace -F _makecomplete gnumake
|
complete -o nospace -F __makefile_completions gnumake
|
||||||
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue