1
     �ÄÆÅ      File not found.
  7   ˆl–Ü4ý()¨‰P@Š»�Á4¦-ÿÈ0a–Ü4ý()¨‰P@Š»�Á4¦-ÿÇ  "   ˆl–Ðz¾”d*j"T%õÆß¸”Å£Êƒ}·�¿È %s    #compdef busctl
# SPDX-License-Identifier: LGPL-2.1-or-later

# busctl(1) completion                               -*- shell-script -*-
#
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# systemd is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <https://www.gnu.org/licenses/>.

(( $+functions[_busctl_commands] )) || _busctl_commands()
{
    local -a _busctl_cmds
    _busctl_cmds=(
        "list:List bus names"
        "status:Show bus service, process or bus owner credentials"
        "monitor:Show bus traffic"
        "capture:Capture bus traffic"
        "tree:Show object tree of service"
        "introspect:Introspect object"
        "call:Call a method"
        "get-property:Get property value"
        "set-property:Set property value"
    )
    if (( CURRENT == 1 )); then
        _describe -t commands 'busctl command' _busctl_cmds || compadd "$@"
    else
        local curcontext="$curcontext"
        cmd="${${_busctl_cmds[(r)$words[1]:*]%%:*}}"
        curcontext="${curcontext%:*:*}:busctl-${cmd}:"
        if (( $+functions[_busctl_$cmd] )); then
            _busctl_$cmd
        else
            _message "no more options"
        fi
    fi
}

__busctl() {
    busctl $_bus_address --no-pager --no-legend "$@" 2>/dev/null
}

__dbus_matchspec() {
    # https://dbus.freedesktop.org/doc/dbus-specification.html#message-bus-routing
    _values -s, 'rules' \
        'type[Match on message type]:type:(signal method_call method_return error)' \
        'eavesdrop[Include unicast messages]:bool:(true false)' \
        'sender[Match messages sent by a particular sender]:sender:{compadd $(_busctl_get_service_names)}'\
        'interface[Match messages sent over or to a particular interface]:interface' \
        'member[Match messages which have the given method or signal name]:member' \
        'path[Match messages which are sent from or to the given object]:path' \
        'path_namespace[Match messages which are sent from or to the given namespace]:namespace' \
        'destination[Match messaged sent to the given unique name]:unique name:{compadd $(_busctl_get_unique_names)}'
}

(( $+functions[_busctl_get_json] )) || _busctl_get_json()
{
    local -a _json_forms
    _json_forms=( $(__busctl --json=help; echo help) )
    _values 'format' $_json_forms
}

(( $+functions[_busctl_get_service_names] )) || _busctl_get_service_names()
{
    local -a bus_names
    bus_names=( $(__busctl call \
        "org.freedesktop.DBus"  \
        "/org/freedesktop/DBus" \
        "org.freedesktop.DBus"  \
        ListNames) )
    echo ${(Q)bus_names[3,-1]}
}

(( $+functions[_busctl_get_unique_names] )) || _busctl_get_unique_names()
{
    local -a bus_names
    local NAME OTHER
    __busctl --unique list |
    while read NAME OTHER; do
        echo $NAME
    done
}

(( $+functions[_busctl_get_objects] )) || _busctl_get_objects()
{
    local -a objects
    local name="$1"
    objects=($(__busctl --list tree $name ))
    echo $objects
}

(( $+functions[_busctl_get_interfaces] )) || _busctl_get_interfaces()
{
    local NAME TYPE OTHER
    __busctl introspect "$1" "$2" |
    while read NAME TYPE OTHER; do
        if [[ ${TYPE} == "interface" ]]; then
            echo ${NAME}
        fi
    done
}

(( $+functions[_busctl_get_members] )) || _busctl_get_members()
{
    local member="$4"
    local required="$5"
    local NAME TYPE SIGNATURE VALUE FLAGS
    __busctl introspect "$1" "$2