__get_machines() {
local a b
- { machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
- { while read a b; do echo " $a"; done; } | \
+ { machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } |
+ { while read a b; do echo " $a"; done; } |
sort -u
}
__get_machines() {
local a b
- { machinectl list-images --full --no-legend --no-pager 2>/dev/null; machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
- { while read a b; do echo " $a"; done; } | \
+ { machinectl list-images --full --no-legend --no-pager 2>/dev/null; machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } |
+ { while read a b; do echo " $a"; done; } |
sort -u
}
__get_machines() {
local a b
- { machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
- { while read a b; do echo " $a"; done; } | \
+ { machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } |
+ { while read a b; do echo " $a"; done; } |
sort -u
}
__get_machines() {
local a b
- { machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
- { while read a b; do echo " $a"; done; } | \
+ { machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } |
+ { while read a b; do echo " $a"; done; } |
sort -u
}
__get_machines() {
local a b
- { machinectl list-images --full --no-legend --no-pager 2>/dev/null; machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
- { while read a b; do echo " $a"; done; } | \
+ { machinectl list-images --full --no-legend --no-pager 2>/dev/null; machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } |
+ { while read a b; do echo " $a"; done; } |
sort -u
}
__get_machines() {
local a b
- { machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
- { while read a b; do echo " $a"; done; } | \
+ { machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } |
+ { while read a b; do echo " $a"; done; } |
sort -u
}
systemctl --system --full --no-legend --no-pager --plain "$@"
}
-__get_slice_units () { __systemctl list-units --all -t slice \
- | { while read -r a b c d; do echo " $a"; done; }; }
+__get_slice_units () { __systemctl list-units --all -t slice |
+ { while read -r a b c d; do echo " $a"; done; }; }
__get_machines() {
local a b
- { machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
- { while read a b; do echo " $a"; done; } | \
+ { machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } |
+ { while read a b; do echo " $a"; done; } |
sort -u
}
}
{% endraw %}
-__get_all_units () { { __systemctl $1 list-unit-files "$2*"; __systemctl $1 list-units --all "$2*"; } \
- | { while read -r a b; do echo " $a"; done; }; }
-__get_non_template_units() { { __systemctl $1 list-unit-files "$2*"; __systemctl $1 list-units --all "$2*"; } \
- | { while read -r a b; do [[ $a =~ @\. ]] || echo " $a"; done; }; }
-__get_template_names () { __systemctl $1 list-unit-files "$2*" \
- | { while read -r a b; do [[ $a =~ @\. ]] && echo " ${a%%@.*}@"; done; }; }
-__get_active_units () { __systemctl $1 list-units "$2*" \
- | { while read -r a b; do echo " $a"; done; }; }
-__get_active_services() { __systemctl $1 list-units "$2*.service" \
- | { while read -r a b; do echo " $a"; done; }; }
+__get_all_units () { { __systemctl $1 list-unit-files "$2*"; __systemctl $1 list-units --all "$2*"; } |
+ { while read -r a b; do echo " $a"; done; }; }
+__get_non_template_units() { { __systemctl $1 list-unit-files "$2*"; __systemctl $1 list-units --all "$2*"; } |
+ { while read -r a b; do [[ $a =~ @\. ]] || echo " $a"; done; }; }
+__get_template_names () { __systemctl $1 list-unit-files "$2*" |
+ { while read -r a b; do [[ $a =~ @\. ]] && echo " ${a%%@.*}@"; done; }; }
+__get_active_units () { __systemctl $1 list-units "$2*" |
+ { while read -r a b; do echo " $a"; done; }; }
+__get_active_services() { __systemctl $1 list-units "$2*.service" |
+ { while read -r a b; do echo " $a"; done; }; }
__get_not_masked_unit_files() {
# filter out masked, not-found, or template units.
- __systemctl $1 list-unit-files --state enabled,enabled-runtime,linked,linked-runtime,static,indirect,disabled,generated,transient "$2*" | \
+ __systemctl $1 list-unit-files --state enabled,enabled-runtime,linked,linked-runtime,static,indirect,disabled,generated,transient "$2*" |
{ while read -r a b; do [[ $a =~ @\. ]] || echo " $a"; done; }
}
__filter_units_by_properties $1 ActiveState=inactive,CanStart=yes $(
{ __get_not_masked_unit_files $1 $2
# get inactive template units
- __systemctl $1 list-units --state inactive,failed "$2*" | \
+ __systemctl $1 list-units --state inactive,failed "$2*" |
{ while read -r a b c; do [[ $b == "loaded" ]] && echo " $a"; done; }
} | sort -u )
}
} | sort -u )
}
-__get_failed_units() { __systemctl $1 list-units "$2*" \
- | while read -r a b c d; do [[ $c == "failed" ]] && echo " $a"; done; }
-__get_enabled_units() { __systemctl $1 list-unit-files "$2*" \
- | while read -r a b c ; do [[ $b == "enabled" ]] && echo " $a"; done; }
-__get_disabled_units() { __systemctl $1 list-unit-files "$2*" \
- | while read -r a b c ; do [[ $b == "disabled" ]] && echo " $a"; done; }
-__get_masked_units() { __systemctl $1 list-unit-files "$2*" \
- | while read -r a b c ; do [[ $b == "masked" ]] && echo " $a"; done; }
+__get_failed_units() { __systemctl $1 list-units "$2*" |
+ while read -r a b c d; do [[ $c == "failed" ]] && echo " $a"; done; }
+__get_enabled_units() { __systemctl $1 list-unit-files "$2*" |
+ while read -r a b c ; do [[ $b == "enabled" ]] && echo " $a"; done; }
+__get_disabled_units() { __systemctl $1 list-unit-files "$2*" |
+ while read -r a b c ; do [[ $b == "disabled" ]] && echo " $a"; done; }
+__get_masked_units() { __systemctl $1 list-unit-files "$2*" |
+ while read -r a b c ; do [[ $b == "masked" ]] && echo " $a"; done; }
__get_all_unit_files() { __systemctl $1 list-unit-files "$2*" | while read -r a b; do echo " $a"; done; }
__get_machines() {
compopt -o filenames
elif __contains_word "$verb" ${VERBS[TARGET_AND_UNITS]}; then
- if __contains_word "$prev" ${VERBS[TARGET_AND_UNITS]} \
- || __contains_word "$prev" ${OPTS[STANDALONE]}; then
- comps=$( __systemctl $mode list-unit-files --type target --all "$cur*" \
- | { while read -r a b; do echo " $a"; done; } )
+ if __contains_word "$prev" ${VERBS[TARGET_AND_UNITS]} ||
+ __contains_word "$prev" ${OPTS[STANDALONE]}; then
+ comps=$( __systemctl $mode list-unit-files --type target --all "$cur*" |
+ { while read -r a b; do echo " $a"; done; } )
else
comps=$( __get_all_unit_files $mode "$cur" )
fi
comps=$( __systemctl $mode list-jobs | { while read -r a b; do echo " $a"; done; } )
elif [ "$verb" = 'unset-environment' ]; then
- comps=$( __systemctl $mode show-environment \
- | while read -r line; do echo " ${line%%=*}"; done )
+ comps=$( __systemctl $mode show-environment |
+ while read -r line; do echo " ${line%%=*}"; done )
compopt -o nospace
elif [ "$verb" = 'set-environment' ]; then
- comps=$( __systemctl $mode show-environment \
- | while read -r line; do echo " ${line%%=*}="; done )
+ comps=$( __systemctl $mode show-environment |
+ while read -r line; do echo " ${line%%=*}="; done )
compopt -o nospace
elif [ "$verb" = 'import-environment' ]; then
compopt -o filenames
elif __contains_word "$verb" ${VERBS[TARGETS]}; then
- comps=$( __systemctl $mode list-unit-files --type target --full --all "$cur*" \
- | { while read -r a b; do echo " $a"; done; } )
+ comps=$( __systemctl $mode list-unit-files --type target --full --all "$cur*" |
+ { while read -r a b; do echo " $a"; done; } )
elif __contains_word "$verb" ${VERBS[LOG_LEVEL]}; then
comps='debug info notice warning err crit alert emerg'
elif __contains_word "$verb" ${VERBS[LOG_TARGET]}; then
__get_machines() {
local a b
- { machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
- { while read a b; do echo " $a"; done; } | \
+ { machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } |
+ { while read a b; do echo " $a"; done; } |
sort -u
}
__get_units_all() {
- systemctl list-units --no-legend --no-pager --plain --all $1 | \
+ systemctl list-units --no-legend --no-pager --plain --all $1 |
{ while read -r a b c; do echo " $a"; done; }
}
__get_services() {
- systemctl list-units --no-legend --no-pager --plain -t service --all $1 | \
+ systemctl list-units --no-legend --no-pager --plain -t service --all $1 |
{ while read -r a b c; do [[ $b == "loaded" ]]; echo " $a"; done; }
}
__get_machines() {
local a b
- { machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
- { while read a b; do echo " $a"; done; } | \
+ { machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } |
+ { while read a b; do echo " $a"; done; } |
sort -u
}
__get_machines() {
local a b
- { machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
- { while read a b; do echo " $a"; done; } | \
+ { machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } |
+ { while read a b; do echo " $a"; done; } |
sort -u
}
__get_tpm2_devices() {
local a b c
- systemd-creds --no-legend --quiet --tpm2-device=list 2>/dev/null | \
+ systemd-creds --no-legend --quiet --tpm2-device=list 2>/dev/null |
{ while read -r a b c; do echo " $a"; done; }
}
__get_creds() {
local a b c
local mode=$1; shift 1
- systemd-creds list $mode --no-legend --no-pager $1 2>/dev/null | \
+ systemd-creds list $mode --no-legend --no-pager $1 2>/dev/null |
{ while read -r a b c; do echo " $a"; done; }
}
__get_machines() {
local a b
- { machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
- { while read a b; do echo " $a"; done; } | \
+ { machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } |
+ { while read a b; do echo " $a"; done; } |
sort -u
}
systemctl $mode --full --no-legend --no-pager --plain "$@"
}
-__get_slice_units () { __systemctl $1 list-units --all -t slice \
- | { while read -r a b c d; do echo " $a"; done; }; }
+__get_slice_units () { __systemctl $1 list-units --all -t slice |
+ { while read -r a b c d; do echo " $a"; done; }; }
__get_properties () {
systemd-analyze transient-settings scope service 2>/dev/null |
__get_machines() {
local a b
- { machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
- { while read -r a b; do echo " $a"; done; } | \
+ { machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } |
+ { while read -r a b; do echo " $a"; done; } |
sort -u
}
__get_machines() {
local a b
- { machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
- { while read a b; do echo " $a"; done; } | \
+ { machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } |
+ { while read a b; do echo " $a"; done; } |
sort -u
}
}
__get_all_device_units() {
- systemctl list-units -t device --full --no-legend --no-pager --plain 2>/dev/null | \
+ systemctl list-units -t device --full --no-legend --no-pager --plain 2>/dev/null |
{ while read -r a b; do echo "$a"; done; }
}
(( $+functions[_localectl_set-locale] )) ||
_localectl_set-locale() {
local -a _locales locale_fields
- locale_fields=(LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME \
- LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER \
- LC_NAME LC_ADDRESS LC_TELEPHONE \
+ locale_fields=(LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME
+ LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER
+ LC_NAME LC_ADDRESS LC_TELEPHONE
LC_MEASUREMENT LC_IDENTIFICATION)
# LC_ALL is omitted on purpose
(( $+functions[__sd_machines_get_machines] )) ||
__sd_machines_get_machines () {
- { machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } | \
- { while read a b; do echo "$a"; done; } | \
+ { machinectl list --full --max-addresses=0 --no-legend --no-pager 2>/dev/null; echo ".host"; } |
+ { while read a b; do echo "$a"; done; } |
sort -u
}
while _tags; do
for i in $groups; do
if _requested ${i//_/-}-commands; then
- _describe -t ${i//_/-}-commands "${i//_/ } command" ${i}_commands \
- && ret=0
+ _describe -t ${i//_/-}-commands "${i//_/ } command" ${i}_commands &&
+ ret=0
fi
done
done
(( $+functions[__systemd-run_get_slices] )) ||
__systemd-run_get_slices () {
- __systemctl list-units --all -t slice \
- | { while read -r a b; do echo $a; done; }
+ __systemctl list-units --all -t slice |
+ { while read -r a b; do echo $a; done; }
}
(( $+functions[__systemd-run_slices] )) ||