Skip to content

Commit

Permalink
feat(dot): support filename extension .gv
Browse files Browse the repository at this point in the history
The dot command from graphviz used .dot for the filename extension in
the past, but .gv is the preferred extension.

References:

#1109
  • Loading branch information
akinomyoga authored and scop committed Feb 19, 2024
1 parent 3b9ce4d commit be0010e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion completions/dot
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ _comp_cmd_dot()
return
fi

_comp_compgen_filedir dot
_comp_compgen_filedir '@(gv|dot)'
} &&
complete -F _comp_cmd_dot dot

Expand Down
Empty file added test/fixtures/dot/test1.gv
Empty file.
Empty file added test/fixtures/dot/test2.dot
Empty file.
8 changes: 8 additions & 0 deletions test/t/test_dot.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,11 @@ class TestDot:
@pytest.mark.complete("dot ")
def test_1(self, completion):
assert completion

@pytest.mark.complete("dot t", cwd="dot")
def test_2(self, completion):
assert completion == ["test1.gv", "test2.dot"]

@pytest.mark.complete("dot test1", cwd="dot")
def test_3(self, completion):
assert completion == ".gv"

0 comments on commit be0010e

Please sign in to comment.