From f031ce581b30c9d014099b755eb3bcfae612268e Mon Sep 17 00:00:00 2001 From: akermu Date: Thu, 17 Sep 2015 19:04:39 +0200 Subject: [PATCH] Make command filtering in zsh completion more robust. - Filter out any lines that don't resemble a command in the help text. - Fixes #1525. --- extra/_beet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/_beet b/extra/_beet index a7533d9a7..055072943 100644 --- a/extra/_beet +++ b/extra/_beet @@ -154,7 +154,7 @@ function _beet_subcmd_options() # Now build the arguments to _regex_arguments for each subcommand. local -a options regex_words_subcmds regex_words_help local subcmd cmddesc -for i in ${${(f)"$(beet help | awk 'f;/Commands:/{f=1}')"[@]}[@]} +for i in ${${(f)"$(beet help | awk 'f;/Commands:/{f=1}' | grep '^ \w.*')"[@]}[@]} do subcmd="${i[(w)1]}" cmddesc="${${${${${i[(w)2,-1]##\(*\) #}//:/-}//\[/(}//\]/)}//\'/}"