Skip to content

Commit 806e689

Browse files
authored
Merge pull request #788 from scop/feat/man-suffixes
feat(man): support zstd and arbitrary lowercase post-numeric-section suffixes
2 parents f736bb0 + 6f69ac0 commit 806e689

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

completions/man

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ _man()
55
local cur prev words cword split
66
_init_completion -s -n : || return
77

8-
local comprsuffix=".@([glx]z|bz2|lzma|Z)"
9-
local manext="@([0-9lnp]|[0-9][px]|man|3?(gl|pm))?($comprsuffix)"
10-
local mansect="@([0-9lnp]|[0-9][px]|3?(gl|pm))"
8+
local comprsuffix=".@([glx]z|bz2|lzma|Z|zst)"
9+
local manext="@([0-9]*([a-z])|[lnp]|man)?($comprsuffix)"
10+
local mansect="@([0-9]*([a-z])|[lnp])"
1111

1212
case $prev in
1313
--config-file | -!(-*)C)
13 Bytes
Binary file not shown.

test/t/test_man.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,11 @@ def test_delimited_deduplication(self, completion):
141141
# no completion, no space appended
142142
assert not completion
143143
assert not completion.endswith(" ")
144+
145+
@pytest.mark.complete(
146+
"man bash-completion-zstd-testcas",
147+
env=dict(MANPATH=manpath),
148+
require_cmd=True,
149+
)
150+
def test_zstd_arbitrary_sectsuffix(self, completion):
151+
assert completion == "e"

0 commit comments

Comments
 (0)