Skip to content

Commit 6f69ac0

Browse files
committed
feat(man): allow arbitrary lowercase ASCII post-numeric-section suffixes
The Linux man-pages project has added `2type`, `3head`, and `3type` recently. A web search for `man3head` gives hits for lists of sections in the wild that are so large that we don't want to enumerate and follow all of them. For example, https://illumos.org/man/ lists 86 different such `man[1-9]` categories at time of writing. Allowing arbitrary lowercase ASCII after a numeric suffix will result in some false positives, but seems the only maintainable option. Closes #778
1 parent 9770123 commit 6f69ac0

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

completions/man

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ _man()
66
_init_completion -s -n : || return
77

88
local comprsuffix=".@([glx]z|bz2|lzma|Z|zst)"
9-
local manext="@([0-9lnp]|[0-9][px]|man|3?(gl|pm))?($comprsuffix)"
10-
local mansect="@([0-9lnp]|[0-9][px]|3?(gl|pm))"
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)

test/t/test_man.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,5 +147,5 @@ def test_delimited_deduplication(self, completion):
147147
env=dict(MANPATH=manpath),
148148
require_cmd=True,
149149
)
150-
def test_zstd(self, completion):
150+
def test_zstd_arbitrary_sectsuffix(self, completion):
151151
assert completion == "e"

0 commit comments

Comments
 (0)