summaryrefslogtreecommitdiffstats
path: root/shell-completion/bash
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-03-30 10:06:50 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-03-30 10:06:50 +0200
commit1e58b1dc40a35d1b0fc8c3cef3ae3c3b7ac481fd (patch)
tree2c5d8b0dc945cb161ace3fd71584de2b9ea4745e /shell-completion/bash
parenttimesync: on network event do not establish connection when NTP servers are n... (diff)
downloadsystemd-1e58b1dc40a35d1b0fc8c3cef3ae3c3b7ac481fd.tar.xz
systemd-1e58b1dc40a35d1b0fc8c3cef3ae3c3b7ac481fd.zip
bash-completion: busctl: suggests only writable properties for set-property
Diffstat (limited to '')
-rw-r--r--shell-completion/bash/busctl5
1 files changed, 3 insertions, 2 deletions
diff --git a/shell-completion/bash/busctl b/shell-completion/bash/busctl
index d077675a32..cfa4d4fa83 100644
--- a/shell-completion/bash/busctl
+++ b/shell-completion/bash/busctl
@@ -58,8 +58,9 @@ __get_members() {
local path=$3
local interface=$4
local type=$5
+ local flags=$6
local a b
- busctl $mode introspect --list --no-legend --no-pager $busname $path $interface | sed -e 's/^\.//' | { while read a b c; do [[ "$b" == "$type" ]] && echo " $a"; done; };
+ busctl $mode introspect --list --no-legend --no-pager $busname $path $interface | sed -e 's/^\.//' | { while read a b c d e; do [[ "$b" == "$type" && ( -z $flags || "$e" == "$flags" ) ]] && echo " $a"; done; };
}
__get_signature() {
@@ -176,7 +177,7 @@ _busctl() {
elif [[ $n -eq 3 ]] ; then
comps=$( __get_interfaces $mode ${COMP_WORDS[COMP_CWORD-2]} ${COMP_WORDS[COMP_CWORD-1]})
elif [[ $n -eq 4 ]] ; then
- comps=$( __get_members $mode ${COMP_WORDS[COMP_CWORD-3]} ${COMP_WORDS[COMP_CWORD-2]} ${COMP_WORDS[COMP_CWORD-1]} property)
+ comps=$( __get_members $mode ${COMP_WORDS[COMP_CWORD-3]} ${COMP_WORDS[COMP_CWORD-2]} ${COMP_WORDS[COMP_CWORD-1]} property writable)
elif [[ $n -eq 5 ]] ; then
comps=$( __get_signature $mode ${COMP_WORDS[COMP_CWORD-4]} ${COMP_WORDS[COMP_CWORD-3]} ${COMP_WORDS[COMP_CWORD-2]} ${COMP_WORDS[COMP_CWORD-1]})
else