From 5c9e073cd57ebb5b7681e8254f101af7f216a807 Mon Sep 17 00:00:00 2001 From: Ruoyu Zhong Date: Tue, 4 Apr 2023 23:04:13 +0800 Subject: [PATCH] commands: fix completion descriptions for shell commands too This was missed in #15146. Signed-off-by: Ruoyu Zhong --- Library/Homebrew/commands.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/commands.rb b/Library/Homebrew/commands.rb index fd6a39fcf2..8d1f6ddf61 100644 --- a/Library/Homebrew/commands.rb +++ b/Library/Homebrew/commands.rb @@ -219,7 +219,9 @@ module Commands match_data = /^#: (?\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