diff options
Diffstat (limited to 'dbus/dbus-bash-completion.sh.in')
-rw-r--r-- | dbus/dbus-bash-completion.sh.in | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/dbus/dbus-bash-completion.sh.in b/dbus/dbus-bash-completion.sh.in new file mode 100644 index 0000000..a7751da --- /dev/null +++ b/dbus/dbus-bash-completion.sh.in @@ -0,0 +1,21 @@ + +# Check for bash +[ -z "$BASH_VERSION" ] && return + +################################################################################ + +__dbus_send() { + local IFS=$'\n' + local cur="${COMP_WORDS[COMP_CWORD]}" + + # --name=value style option + if [[ "$cur" == *=* ]] ; then + cur=${cur/*=/} + fi + + COMPREPLY=($(compgen -W "$(@libexecdir@/dbus-bash-completion-helper dbus-send ${COMP_WORDS[@]:0})" -- $cur)) +} + +################################################################################ + +complete -o nospace -F __dbus_send dbus-send |