commands: fix completion descriptions for shell commands too

This was missed in #15146.

Signed-off-by: Ruoyu Zhong <zhongruoyu@outlook.com>
This commit is contained in:
Ruoyu Zhong 2023-04-04 23:04:13 +08:00
parent 4305443c9c
commit 5c9e073cd5
No known key found for this signature in database
GPG Key ID: 42F3B7E577C2156A

View File

@ -219,7 +219,9 @@ module Commands
match_data = /^#: (?<desc>\w.*+)$/.match(line)
if match_data
desc = match_data[:desc]
return T.must(desc).split(".").first if short
# The same splitting logic is used here.
# See comment for Ruby commands above.
return T.must(desc).split(/\.(?>\s|$)/).first if short
return desc
end