zsh-workers
 help / color / mirror / code / Atom feed
37b5458d7eda5591eee887df704ce2a4bcc6a0d6 blob 4806 bytes (raw)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
 
#compdef dbus-send dbus-monitor dbus-launch

local curcontext="$curcontext" state line expl find end ret=1
typeset -A opt_args
local -a suf introspect interfaces

case $service in
  dbus-send)
    _arguments -A "--*" -C \
      '(--session)--system' '(--system)--session' \
      '--address=-:bus address:->addresses' \
      '--dest=-:connection:->connections' \
      '--print-reply=-::format:(literal)' \
      '--reply-timeout=-:timeout (ms)' \
      '--type=-:type:(method_call signal)' \
      '(* -)--help' \
      ':object path:->objectpaths' \
      ':message name:->methods' \
      ':content:->contents' && ret=0
  ;;
  dbus-monitor)
    _arguments -A "--*" -C \
      '*:watch expression:->expressions' \
      - '(bus)' \
      --system --session \
      '--address=-:bus address:->addresses' \
      - '(format)' \
      --monitor --profile --pcap --binary && ret=0
  ;;
  dbus-launch)
    _arguments -C \
      --version"[print the version of dbus-launch]" \
      --help"[print the help info of dbus-launch]" \
      --sh-syntax"[emit bourne-shell compatible code to set up environment variables]" \
      --csh-syntax"[emit csh compatible code to set up environment variables]" \
      --auto-syntax"[choose --csh-syntax or --sh-syntax based on the SHELL environment variable]" \
      --binary-syntax"[use a nul-terminated syntax with the environment data]" \
      --close-stderr"[close stderr stream before starting the d-bus daemon]" \
      --exit-with-session"[create a persistent \"babysitter\" process]" \
      --exit-with-x11"[create a persistent \"babysitter\" process that will connect to the x server]" \
      --autolaunch="[scan for a previously-started session and reuse the values found there]:machine id:->machine-id" \
      --config-file="[pass --config-file=FILENAME to the bus daemon]" && ret=0
  ;;
esac

case $state in
  addresses)
    compset -P '*;'
    if compset -P 1 '*='; then
      _files && ret=0
    else
      _message -e addresses address
    fi
  ;;
  connections)
    _wanted connections expl connection compadd ${=${(M)PREFIX:#*.*}:+-M 'r:|.=* r:|=*'} ${$(_call_program connections dbus-send ${opt_args[(I)--system]} --print-reply=literal --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ListActivatableNames 2>/dev/null):#(array|\[|\])} ${$(_call_program connections dbus-send ${opt_args[(I)--system]} --print-reply=literal --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ListNames 2>/dev/null):#(array|\[|\])} && ret=0
  ;;
  objectpaths)
    if [[ -prefix / ]]; then
      compset -P ${PREFIX%%[^/]#}
      _wanted objectpaths expl 'object path' compadd -qS/ ${${${(M)${(f)"$(_call_program objectpaths dbus-send --print-reply ${(M)words:#(--dest=|--system|--address=)*} ${${IPREFIX%/}:-/} org.freedesktop.DBus.Introspectable.Introspect 2>/dev/null)"}:#*node name=[^/]##\"*}#*\"}%\"*} && ret=0
    else
      _wanted objectpaths expl 'object path' compadd -S '/' -r '-=' '' && ret=0
    fi
  ;;
  methods)
    introspect=( ${(M)${(f)"$(_call_program methods dbus-send --print-reply ${(M)words:#(--dest=|--system|--address=|/)*} org.freedesktop.DBus.Introspectable.Introspect 2>/dev/null)"}:#*name=*} )
    interfaces=( ${${${(M)introspect:#*interface name=*}#*\"}%\"*} )
    _wanted interfaces expl interface compadd -qS. -M 'r:|.=* r:|=*' -a interfaces && ret=0
    if [[ $compstate[nmatches] != $#interfaces ]] && compset -P '*.'; then
      find="*interface name=?${IPREFIX%.}??"
      end=${interfaces[(i)${IPREFIX%.}]}
      _wanted methods expl method compadd ${${${(M)${${introspect[${introspect[(i)$find]}+1,(in.end+1.)*interface name=*]}:#*interface name=*}:#*${${opt_args[--type]%_*}:-method} name=*}#*\"}%\"*} && ret=0
    fi
  ;;
  contents)
    compset -S ':*' || suf=( -S : )
    while compset -P '(array|dict|variant):'; do
      :
    done
    if compset -P '*:'; then
      _message -e value 'value'
    else
      _alternative -O suf \
        'containers:container:(array dict variant)' \
	'types:type:(string double byte boolean objpath '${(j. .):-{,u}int{16,32,64}}\) && ret=0
    fi
  ;;
  expressions)
    _values -w -s , 'expression' \
      'type:message type:(signal method_call method_return error)' \
      'sender:bus or name' \
      'interface:interface' \
      'member:member' \
      'path:path' \
      'path_namespace:path' \
      'destination:unique name' \
      arg{0..9}:value \
      'arg0namespace:namespace' \
      'eavesdrop:eavesdropping:(true false)' && ret=0
  ;;
  machine-id)
    { local machine_id="$(</var/lib/dbus/machine-id)" } 2>/dev/null
    if [[ -n "$machine_id" ]]; then
        _wanted machine-ids expl machine-id compadd $machine_id && ret=0
    else
        _message "No /var/lib/dbus/machine-id found" && ret=0
    fi
  ;;
esac

return ret
debug log:

solving 37b5458d7 ...
found 37b5458d7 in https://git.vuxu.org/mirror/zsh/

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).