Skip to content

Commit 34d040b

Browse files
committed
feat(configure): fall back to filedir for unhandled cases
Closes scop#503
1 parent db70c67 commit 34d040b

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

completions/configure

+4-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ _configure()
2020
;;
2121
esac
2222

23-
$split && return
24-
25-
[[ $cur != -* ]] && return
23+
if $split || [[ $cur != -* ]]; then
24+
_filedir
25+
return
26+
fi
2627

2728
# if $COMP_CONFIGURE_HINTS is not null, then completions of the form
2829
# --option=SETTING will include 'SETTING' as a contextual hint

test/t/test_configure.py

+8
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,11 @@ def test_1(self, completion):
1515
@pytest.mark.complete("configure --prefix ")
1616
def test_2(self, completion):
1717
assert completion
18+
19+
@pytest.mark.complete("configure --unknown-option-with-split=")
20+
def test_unknown_split_filedir_fallback(self, completion):
21+
assert "shared/" in completion
22+
23+
@pytest.mark.complete("configure --unknown-option ")
24+
def test_unknown_filedir_fallback(self, completion):
25+
assert "shared/" in completion

0 commit comments

Comments
 (0)