if ! __contains_word "${COMP_WORDS[i]}" ${OPTS[*]} ${VERBS[*]} &&
! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
name=${COMP_WORDS[i]}
- break;
+ break
fi
done
local mode=$1
local a b
busctl $mode list --no-legend --no-pager --full 2>/dev/null |
- { while read a b; do echo " $a"; done; };
+ { while read a b; do echo " $a"; done; }
}
__get_objects() {
local busname=$2
local a b
busctl $mode tree --list --no-legend --no-pager $busname 2>/dev/null |
- { while read a b; do echo " $a"; done; };
+ { while read a b; do echo " $a"; done; }
}
__get_interfaces() {
local path=$3
local a b c
busctl $mode introspect --list --no-legend --no-pager $busname $path 2>/dev/null |
- { while read a b c; do [[ "$b" == "interface" ]] && echo " $a"; done; };
+ { while read a b c; do [[ "$b" == "interface" ]] && echo " $a"; done; }
}
__get_members() {
local a b c d e
busctl $mode introspect --list --no-legend --no-pager $busname $path $interface 2>/dev/null |
sed -e 's/^\.//' |
- { while read a b c d e; do [[ "$b" == "$type" && ( -z $flags || "$e" == "$flags" ) ]] && echo " $a"; done; };
+ { while read a b c d e; do [[ "$b" == "$type" && ( -z $flags || "$e" == "$flags" ) ]] && echo " $a"; done; }
}
__get_signature() {
local member=$5
local a b c d
busctl $mode introspect --list --no-legend --no-pager $busname $path $interface 2>/dev/null |
- sed -e 's/^\.//' | { while read a b c d; do [[ "$a" == "$member" && "$c" != '-' ]] && echo " \"$c\""; done; };
+ sed -e 's/^\.//' | { while read a b c d; do [[ "$a" == "$member" && "$c" != '-' ]] && echo " \"$c\""; done; }
}
_busctl() {
__get_machines() {
local a b
machinectl list --full --no-legend --no-pager 2>/dev/null |
- { while read a b; do echo " $a"; done; };
+ { while read a b; do echo " $a"; done; }
}
__get_homes() {
__get_machines() {
local a b
machinectl list --full --no-legend --no-pager 2>/dev/null |
- { while read a b; do echo " $a"; done; };
+ { while read a b; do echo " $a"; done; }
}
_hostnamectl() {
if __contains_word "$prev" '>' '>>' '&>'; then
compopt -o filenames
COMPREPLY=( $(compgen -f -- "$cur") )
- return 0;
+ return 0
fi
if __contains_word "$prev" ${OPTS[ARG]} ${OPTS[ARGUNKNOWN]}; then
}
__get_links() {
- networkctl list --no-legend --no-pager --all --full | { while read -r a b c; do echo " $b"; done; };
+ networkctl list --no-legend --no-pager --all --full | { while read -r a b c; do echo " $b"; done; }
}
__get_links_with_prefix() {
if __contains_word "${COMP_WORDS[i]}" ${ARGS[FAMILY]} &&
! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
name=${COMP_WORDS[i]}
- break;
+ break
fi
done
if [[ -z $name ]]; then
if __contains_word "${COMP_WORDS[i]}" $interfaces &&
! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
name=${COMP_WORDS[i]}
- break;
+ break
fi
done
if __contains_word "${COMP_WORDS[i]}" ${ARGS[RESOLVE]} &&
! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
name=${COMP_WORDS[i]}
- break;
+ break
fi
done
if __contains_word "${COMP_WORDS[i]}" ${ARGS[BOOLEAN]} &&
! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
name=${COMP_WORDS[i]}
- break;
+ break
fi
done
if __contains_word "${COMP_WORDS[i]}" ${ARGS[DNSSEC]} &&
! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
name=${COMP_WORDS[i]}
- break;
+ break
fi
done
if __contains_word "${COMP_WORDS[i]}" ${ARGS[DNSOVERTLS]} &&
! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
name=${COMP_WORDS[i]}
- break;
+ break
fi
done
compopt -o filenames
elif __contains_word "$verb" ${VERBS[DISABLED_UNITS]}; then
- comps=$( __get_disabled_units $mode "$cur";
+ comps=$( __get_disabled_units $mode "$cur"
__get_template_names $mode "$cur")
compopt -o filenames
elif __contains_word "$verb" ${VERBS[REENABLABLE_UNITS]}; then
- comps=$( __get_disabled_units $mode "$cur";
- __get_enabled_units $mode "$cur";
+ comps=$( __get_disabled_units $mode "$cur"
+ __get_enabled_units $mode "$cur"
__get_template_names $mode "$cur")
compopt -o filenames
if [[ $cur = -* ]]; then
comps='--help --version --system --user --global --man=no --generators=yes --root --image --recursive-errors=no --recursive-errors=yes --recursive-errors=one'
else
- comps=$( compgen -A file -- "$cur";
+ comps=$( compgen -A file -- "$cur"
__get_units_all $mode )
compopt -o filenames
fi
while read -r a b c d; do
[[ $c == "active" && ${a##*.} =~ (service|socket|mount|swap|slice|scope) ]] && echo " $a"
done
- };
+ }
}
_systemd_cgls() {
__get_users() {
local a b
- loginctl list-users --no-legend --no-pager | { while read a b; do echo " $b"; done; };
+ loginctl list-users --no-legend --no-pager | { while read a b; do echo " $b"; done; }
}
__get_slices() {
local a b
- systemctl list-units -t slice --no-legend --no-pager --plain | { while read a b; do echo " $a"; done; };
+ systemctl list-units -t slice --no-legend --no-pager --plain | { while read a b; do echo " $a"; done; }
}
__get_machines() {
__get_env() {
local a
- env | { while read a; do echo " ${a%%=*}"; done; };
+ env | { while read a; do echo " ${a%%=*}"; done; }
}
__get_interfaces(){
(( $+functions[_systemctl_all_units] )) ||
_systemctl_all_units()
{
- if _cache_invalid SYS_ALL_UNITS$_sys_service_mgr || ! _retrieve_cache SYS_ALL_UNITS$_sys_service_mgr;
+ if _cache_invalid SYS_ALL_UNITS$_sys_service_mgr || ! _retrieve_cache SYS_ALL_UNITS$_sys_service_mgr
then
_sys_all_units=( ${${(f)"$(__systemctl list-units --all)"}%% *} )
_store_cache SYS_ALL_UNITS$_sys_service_mgr _sys_all_units
(( $+functions[_systemctl_really_all_units] )) ||
_systemctl_really_all_units()
{
- local -a all_unit_files;
- local -a really_all_units;
- if _cache_invalid SYS_REALLY_ALL_UNITS$_sys_service_mgr || ! _retrieve_cache SYS_REALLY_ALL_UNITS$_sys_service_mgr;
+ local -a all_unit_files
+ local -a really_all_units
+ if _cache_invalid SYS_REALLY_ALL_UNITS$_sys_service_mgr || ! _retrieve_cache SYS_REALLY_ALL_UNITS$_sys_service_mgr
then
all_unit_files=( ${${(f)"$(__systemctl list-unit-files)"}%% *} )
_systemctl_all_units
(( $+functions[__systemd-run_get_slices] )) ||
__systemd-run_get_slices () {
__systemctl list-units --all -t slice \
- | { while read -r a b; do echo $a; done; };
+ | { while read -r a b; do echo $a; done; }
}
(( $+functions[__systemd-run_slices] )) ||