summaryrefslogtreecommitdiffstats
path: root/shell-completion/zsh/_busctl
diff options
context:
space:
mode:
authorRonan Pigott <ronan@rjp.ie>2023-09-09 00:27:39 +0200
committerLuca Boccassi <luca.boccassi@gmail.com>2023-09-09 02:28:07 +0200
commit47f20650b7b3238ef6374ece9fa74416a5e07c25 (patch)
tree0cbfacd7857745c0a88a75bf41d8bdf08fdd78d3 /shell-completion/zsh/_busctl
parentRevert "tree-wide: Mount file descriptors via /proc/<pid>/fd" (diff)
downloadsystemd-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/_busctl4
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])