completions/makefile: Respect POSIX compatibility

Co-authored-by: Koichi Murase <myoga.murase@gmail.com>
This commit is contained in:
Jean-Sébastien Hedde
2021-12-28 15:36:49 +01:00
committed by Koichi Murase
parent f364333dfd
commit e0abffc8af

View File

@@ -1,3 +1,3 @@
# Add completion for Makefile
# see http://stackoverflow.com/a/38415982/1472048
complete -W "\`find . -maxdepth 1 -iname '*makefile' -exec grep -oE '^[a-zA-Z0-9_-]+:([^=]|$)' {} \; | sed 's/[^a-zA-Z0-9_-]*$//'\`" make
complete -W "\`shopt -u nullglob; shopt -s nocaseglob; grep -oE '^[a-zA-Z0-9_-]+:([^=]|$)' *makefile 2>/dev/null | sed 's/[^a-zA-Z0-9_-]*$//'\`" make