Skip to content

Commit 1fa691a

Browse files
committed
feat(tree): support long option args separated by equals sign
As of 1.8.0, support for this seems somewhat inconsistent though, but it works for most. Notably it does not work for `--timefmt=foo`, but let's just ignore that inconvenient fact.
1 parent 2059ac8 commit 1fa691a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

completions/tree

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
_comp_cmd_tree()
44
{
5-
local cur prev words cword
6-
_init_completion || return
5+
local cur prev words cword split
6+
_init_completion -s || return
77

88
case $prev in
99
-!(-*)[LPIHT] | --filelimit | --timefmt | --help | --version)
@@ -23,6 +23,8 @@ _comp_cmd_tree()
2323
;;
2424
esac
2525

26+
$split && return
27+
2628
if [[ $cur == -* ]]; then
2729
COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur"))
2830
return

test/t/test_tree.py

+4
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,7 @@ def test_fromfile(self, completion):
1313
@pytest.mark.complete("tree -", require_cmd=True)
1414
def test_options(self, completion):
1515
assert completion
16+
17+
@pytest.mark.complete("tree --sort=", require_cmd=True)
18+
def test_equals_sign_split(self, completion):
19+
assert completion

0 commit comments

Comments
 (0)