From 1e58b1dc40a35d1b0fc8c3cef3ae3c3b7ac481fd Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Fri, 30 Mar 2018 17:06:50 +0900 Subject: bash-completion: busctl: suggests only writable properties for set-property --- shell-completion/bash/busctl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'shell-completion') 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 -- cgit v1.2.2