From 2c94b597bd218c2a0b9c111fcdd1588e8611f7a9 Mon Sep 17 00:00:00 2001 From: Sebastian Gniazdowski Date: Tue, 29 Oct 2019 14:27:59 +0100 Subject: github #41: Extend _dbus with dbus-launch completion --- ChangeLog | 2 ++ Completion/Unix/Command/_dbus | 24 +++++++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 21812799a..bee827d9c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2019-10-29 Oliver Kiddle + * github #41: Sebastian: Extend _dbus with dbus-launch completion + * unposted: Completion/Unix/Command/_zfs: tweak to check for openzfs rather than Solaris diff --git a/Completion/Unix/Command/_dbus b/Completion/Unix/Command/_dbus index 3f106cb5c..37b5458d7 100644 --- a/Completion/Unix/Command/_dbus +++ b/Completion/Unix/Command/_dbus @@ -1,4 +1,4 @@ -#compdef dbus-send dbus-monitor +#compdef dbus-send dbus-monitor dbus-launch local curcontext="$curcontext" state line expl find end ret=1 typeset -A opt_args @@ -27,6 +27,20 @@ case $service in - '(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 @@ -85,6 +99,14 @@ case $state in 'arg0namespace:namespace' \ 'eavesdrop:eavesdropping:(true false)' && ret=0 ;; + machine-id) + { local machine_id="$(/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 -- cgit 1.4.1