chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
hashmap: return more information from resize_buckets()
[elogind.git]
/
shell-completion
/
bash
/
busctl
diff --git
a/shell-completion/bash/busctl
b/shell-completion/bash/busctl
index 0727241460dce63fefb395cff336c95cdcee1135..49520e48d2b2732a7f9b29b9e0ede4e3637c940b 100644
(file)
--- a/
shell-completion/bash/busctl
+++ b/
shell-completion/bash/busctl
@@
-31,19
+31,26
@@
__get_machines() {
}
__get_endpoints() {
}
__get_endpoints() {
+ local mode=$1
local a b
local a b
- busctl
list
--no-pager | { while read a b; do echo " $a"; done; };
+ busctl
$mode list --no-legend
--no-pager | { while read a b; do echo " $a"; done; };
}
_busctl() {
}
_busctl() {
- local i verb comps
+ local i verb comps
mode
local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
local -A OPTS=(
local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
local -A OPTS=(
- [STANDALONE]='-h --help --version --no-pager --system --user
+ [STANDALONE]='-h --help --version --no-pager --
no-legend --
system --user
--show-machine --unique --acquired --activatable'
[ARG]='-H --host -M --machine --address --match'
)
--show-machine --unique --acquired --activatable'
[ARG]='-H --host -M --machine --address --match'
)
+ if __contains_word "--user" ${COMP_WORDS[*]}; then
+ mode=--user
+ else
+ mode=--system
+ fi
+
if __contains_word "$prev" ${OPTS[ARG]}; then
case $prev in
--host|-H)
if __contains_word "$prev" ${OPTS[ARG]}; then
case $prev in
--host|-H)
@@
-79,7
+86,7
@@
_busctl() {
elif __contains_word "$verb" ${VERBS[STANDALONE]}; then
comps=''
elif __contains_word "$verb" ${VERBS[ENDPOINT]}; then
elif __contains_word "$verb" ${VERBS[STANDALONE]}; then
comps=''
elif __contains_word "$verb" ${VERBS[ENDPOINT]}; then
- comps=$( __get_endpoints )
+ comps=$( __get_endpoints
$mode
)
fi
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
fi
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )