From 0bc58b66a4850cdb8458a86c3d9a2fc81de82aa3 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 11:14:42 +0200 Subject: Adding upstream version 1:2.11. Signed-off-by: Daniel Baumann --- completions/make | 170 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 completions/make (limited to 'completions/make') diff --git a/completions/make b/completions/make new file mode 100644 index 0000000..96517c2 --- /dev/null +++ b/completions/make @@ -0,0 +1,170 @@ +# bash completion for GNU make -*- shell-script -*- + +_make_target_extract_script() +{ + local mode="$1" + shift + + local prefix="$1" + local prefix_pat=$(command sed 's/[][\,.*^$(){}?+|/]/\\&/g' <<<"$prefix") + local basename=${prefix##*/} + local dirname_len=$((${#prefix} - ${#basename})) + + if [[ $mode == -d ]]; then + # display mode, only output current path component to the next slash + local output="\2" + else + # completion mode, output full path to the next slash + local output="\1\2" + fi + + cat <