<div dir="ltr"><div>---</div><div> completions/make              |  9 ++++++++-</div><div> test/fixtures/make/Makefile   | 16 ++++++++++++++++</div><div> test/lib/completions/make.exp | 27 +++++++++++++++++++++++++++</div><div> 3 files changed, 51 insertions(+), 1 deletion(-)</div><div><br></div><div>diff --git a/completions/make b/completions/make</div><div>index 3f697be..e84e5ba 100644</div><div>--- a/completions/make</div><div>+++ b/completions/make</div><div>@@ -61,9 +61,16 @@ function _make_target_extract_script()</div><div>       /^\.POSIX:/                 d;            # special target</div><div>       /^\.NOEXPORT:/              d;            # special target</div><div>       /^\.MAKE:/                  d;            # special target</div><div>+EOF</div><div> </div><div>-      /^[^a-zA-Z0-9]/             d;            # convention for hidden tgt</div><div>+    # don't complete with hidden targets unless we are doing a partial completion</div><div>+    if [[ -z "${prefix_pat}" || "${prefix_pat}" = */ ]]; then</div><div>+      cat <<EOF</div><div>+      /^${prefix_pat}[^a-zA-Z0-9]/d             # convention for hidden tgt</div><div>+EOF</div><div>+    fi</div><div> </div><div>+    cat <<EOF</div><div>       h;                                        # hold target</div><div>       d;                                        # delete line</div><div>     }</div><div>diff --git a/test/fixtures/make/Makefile b/test/fixtures/make/Makefile</div><div>index 1a59f21..3d1d5f3 100644</div><div>--- a/test/fixtures/make/Makefile</div><div>+++ b/test/fixtures/make/Makefile</div><div>@@ -20,6 +20,22 @@ install: all</div><div> clean:</div><div> <span class="" style="white-space:pre">      </span>-rm -f $(NAME)</div><div> </div><div>+.test_passes:</div><div>+<span class="" style="white-space:pre">      </span>./sample >/dev/null</div><div>+<span class="" style="white-space:pre">    </span>touch ^@</div><div>+</div><div>+.cache/.1:</div><div>+<span class="" style="white-space:pre">        </span>touch $@</div><div>+</div><div>+.cache/.2:</div><div>+<span class="" style="white-space:pre">        </span>touch $@</div><div>+</div><div>+.cache/1:</div><div>+<span class="" style="white-space:pre"> </span>touch $@</div><div>+</div><div>+.cache/2:</div><div>+<span class="" style="white-space:pre"> </span>touch $@</div><div>+</div><div> ifndef __BASH_MAKE_COMPLETION__</div><div> -include sample.d</div><div> endif</div><div>diff --git a/test/lib/completions/make.exp b/test/lib/completions/make.exp</div><div>index 977485d..25551a3 100644</div><div>--- a/test/lib/completions/make.exp</div><div>+++ b/test/lib/completions/make.exp</div><div>@@ -28,6 +28,33 @@ assert_complete_dir $targets "make " $dir $test</div><div> sync_after_int</div><div> </div><div> </div><div>+set test "\"make .<TAB>\" should complete hidden targets"</div><div>+set dir $::srcdir/fixtures/make</div><div>+set targets ".test_passes .cache/"</div><div>+assert_complete_dir $targets "make ." $dir $test</div><div>+</div><div>+</div><div>+sync_after_int</div><div>+</div><div>+</div><div>+set test "\"make .cache/<TAB>\" should complete targets"</div><div>+set dir $::srcdir/fixtures/make</div><div>+set targets "1 2"</div><div>+assert_complete_dir $targets "make .cache/" $dir $test</div><div>+</div><div>+</div><div>+sync_after_int</div><div>+</div><div>+</div><div>+set test "\"make .cache/.<TAB>\" should complete hidden targets"</div><div>+set dir $::srcdir/fixtures/make</div><div>+set targets ".1 .2"</div><div>+assert_complete_dir $targets "make .cache/." $dir $test</div><div>+</div><div>+</div><div>+sync_after_int</div><div>+</div><div>+</div><div> set test "\"make <TAB>\" should not show anything in directory without makefile"</div><div> set dir $::srcdir/fixtures/make/empty_dir</div><div> assert_complete_dir "" "make " $dir $test</div><div>-- </div><div>1.9.1</div><div><br></div></div>