Skip to content

Instantly share code, notes, and snippets.

View ericpardee's full-sized avatar

ericpardee ericpardee

View GitHub Profile
# Define make completions
function _make_completions() {
local -a targets
if [[ -f 'Makefile' ]]; then
# Read targets from Makefile using Extended Regular Expressions
# This regex aims to match any target that does not start with a dot and includes more characters than before.
targets=($(grep -oE '^[^\.#][^ ]*:' Makefile | sed 's/:.*//'))
fi
# Define completions based on targets