Skip to content

Commit 3368d9b

Browse files
authored
fix(export): do not output equals sign for -f arg completions (scop#779)
1 parent 36ceb27 commit 3368d9b

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

completions/export

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ _export()
5252
return
5353
fi
5454
local suffix=""
55-
if ! $remove; then
55+
if ! $remove && [[ $action != function ]]; then
5656
suffix="="
5757
compopt -o nospace
5858
fi

test/t/test_export.py

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import pytest
22

3+
from conftest import assert_bash_exec
4+
35

46
class TestExport:
57
@pytest.mark.complete("export BASH")
@@ -34,3 +36,13 @@ def test_7(self, completion):
3436
@pytest.mark.complete("export -", require_cmd=True)
3537
def test_8(self, completion):
3638
assert completion
39+
40+
@pytest.fixture(scope="class")
41+
def export_f_canary(self, request, bash):
42+
assert_bash_exec(bash, "_comp__test_export_f_canary() { return; }")
43+
44+
@pytest.mark.complete("export -f _comp__test_export_f_canar")
45+
def test_no_equals_sign_for_function(self, completion, export_f_canary):
46+
assert completion
47+
assert "=" not in "".join(completion)
48+
assert completion.endswith(" ")

0 commit comments

Comments
 (0)