Skip to content

Instantly share code, notes, and snippets.

@memilanuk
Created February 2, 2020 21:38
Show Gist options
  • Save memilanuk/d74371704c5d37d9d7fbe815954d173c to your computer and use it in GitHub Desktop.
Save memilanuk/d74371704c5d37d9d7fbe815954d173c to your computer and use it in GitHub Desktop.
_make is a function
_make ()
{
local cur;
COMPREPLY=();
cur="${COMP_WORDS[COMP_CWORD]}";
if [[ ${cur} != -* ]]; then
local glob=$(shopt -p nullglob);
shopt -s nullglob;
COMPREPLY=($(compgen -W "$(for f in *.c; do echo ${f%.c}; done)" -- ${cur}));
eval "${glob}" &> /dev/null;
return 0;
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment