$NetBSD: patch-Completion_Unix_Command___gpg,v 1.2 2022/05/16 14:58:30 ryoon Exp $ Fix an issue in _gpg. Simply typing "gpg2 [TAB]" fails with an error: _gpg:176: \[]*} not found [pho@] I couldn't figure out what was really going on. These nested parameter expansions don't look wrong, yet zsh-5.8 somehow fails to process them. Maybe it's misinterpreted as an indexed array assignment? Creating arrays with unquoted values is a bad idea anyway, because they can easily cause shell expansions in a totally unexpected way. --- Completion/Unix/Command/_gpg.orig 2022-05-08 06:18:22.000000000 +0000 +++ Completion/Unix/Command/_gpg @@ -173,8 +173,8 @@ fi '--dump-options[show all options]' ) -extra=( ${${${args#\([^\)]#\)}#\*}%%[=:\[]*} ) -extra=( ${allopts:|extra} ) +extra=( "${(@)${(@)${(@)args#\([^\)]#\)}#\*}%%[:=\[]*}" ) +extra=( "${(@)allopts:|extra}" ) _arguments -C -s -S -A "-*" $args $extra '*:args:->args' && ret=0 if [[ $state = args ]]; then