summaryrefslogtreecommitdiff
path: root/shell-completion/zsh/_sd_machines
diff options
context:
space:
mode:
authorFelipe Sateler <fsateler@debian.org>2019-02-20 21:24:33 -0300
committerFelipe Sateler <fsateler@debian.org>2019-02-20 21:24:33 -0300
commit7c20daf69c4411979b7f8902f3601d1cdc56cc07 (patch)
treed59b9989ce55ed23693e80974d94c856f1c2c8b1 /shell-completion/zsh/_sd_machines
parent6e866b331d7cd4a5e0759dd160dea6edabd3678e (diff)
downloadsystemd-upstream/241.tar.gz
New upstream version 241upstream/241
Diffstat (limited to 'shell-completion/zsh/_sd_machines')
-rw-r--r--shell-completion/zsh/_sd_machines6
1 files changed, 4 insertions, 2 deletions
diff --git a/shell-completion/zsh/_sd_machines b/shell-completion/zsh/_sd_machines
index ab35cf84b3..e783620b97 100644
--- a/shell-completion/zsh/_sd_machines
+++ b/shell-completion/zsh/_sd_machines
@@ -1,11 +1,13 @@
#autoload
# SPDX-License-Identifier: LGPL-2.1+
-__get_machines () {
+
+(( $+functions[__sd_machines_get_machines] )) ||
+__sd_machines_get_machines () {
machinectl --full --no-legend --no-pager list | {while read -r a b; do echo $a; done;};
}
local -a _machines
-_machines=("${(fo)$(__get_machines)}")
+_machines=("${(fo)$(__sd_machines_get_machines)}")
typeset -U _machines
if [[ -n "$_machines" ]]; then
_describe 'machines' _machines