diff options
author | Ronan Pigott <ronan@rjp.ie> | 2023-09-09 00:27:39 +0200 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2023-09-09 02:28:07 +0200 |
commit | 47f20650b7b3238ef6374ece9fa74416a5e07c25 (patch) | |
tree | 0cbfacd7857745c0a88a75bf41d8bdf08fdd78d3 /shell-completion/zsh/_busctl | |
parent | Revert "tree-wide: Mount file descriptors via /proc/<pid>/fd" (diff) | |
download | systemd-47f20650b7b3238ef6374ece9fa74416a5e07c25.tar.xz systemd-47f20650b7b3238ef6374ece9fa74416a5e07c25.zip |
zsh: busctl: fix flags parsing for properties
I'm not quite sure what the original intent of this line was, but it
doesn't work in the one call-site the "required" argument is actually
used. The "writable" flag was indexed as a scalar leaving only the
"e" to compare against.
Instead, let's just sort the parsed flags and compare the whole thing.
Also substitute "required" as a pattern, so that pattern based
comparisons may be supported.
Diffstat (limited to '')
-rw-r--r-- | shell-completion/zsh/_busctl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/shell-completion/zsh/_busctl b/shell-completion/zsh/_busctl index b0cd4d5db5..70f9e74036 100644 --- a/shell-completion/zsh/_busctl +++ b/shell-completion/zsh/_busctl @@ -118,7 +118,7 @@ __dbus_matchspec() { __busctl introspect "$1" "$2" "$3" | while read NAME TYPE SIGNATURE VALUE FLAGS; do [[ -z "$member" || ${TYPE} == "$member" ]] && - [[ -z "$required" || ${${(s: :)FLAGS}[-1]} == "$required" ]] && + [[ -z "$required" || "${${(os: :)FLAGS}}" == $~required ]] && echo ${NAME#.} done } @@ -244,7 +244,7 @@ __dbus_matchspec() { ;; 5) _wanted property expl 'property' \ - compadd "$@" - $(_busctl_get_members $words[2,4] "property" "writable") + compadd "$@" - $(_busctl_get_members $words[2,4] "property" "*writable*") ;; 6) compadd "$@" - $(_busctl_get_signature $words[2,5]) |