Fix broken completion and use awk instead of perl for portability

This commit is contained in:
Shohei YOSHIDA 2023-01-10 10:54:42 +09:00
parent 45d07f79b0
commit 4ac9173088
No known key found for this signature in database
GPG Key ID: C9A1BB11BB940CF2
1 changed files with 9 additions and 1 deletions

View File

@ -33,7 +33,7 @@
_gpgconf_component() {
local values=(
"${(@f)$(gpgconf --list-components | perl -F: -ale 'print "${F[0]}[$F[1]]"')}"
"${(@f)$(gpgconf --list-components | awk -F: '{printf "%s[%s]\n", $1, $2}')}"
)
if [ "${action[2]}" = all ]; then
values+=('all[All daemon components]')
@ -67,3 +67,11 @@ _arguments \
'(-q --quiet)'{-q,--quiet}'[quiet]' \
'(-n --dry-run)'{-n,--dry-run}'[do not make any changes]' \
'(-r --runtime)'{-r,--runtime}'[activate changes at runtime, if possible]'
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et